Refactor distance, speed and volume utils (#77952)
* Refactor distance util * Fix bmw connected drive tests * Adjust here travel time tests * Adjust waze travel time tests * Adjust test_distance * Adjust rounding values * Adjust more tests * Adjust volume conversions * Add tests
This commit is contained in:
parent
01f1629ac0
commit
9490771a87
9 changed files with 248 additions and 131 deletions
|
@ -177,13 +177,17 @@ def test_length_unknown_unit():
|
|||
def test_length_to_metric():
|
||||
"""Test length conversion to metric system."""
|
||||
assert METRIC_SYSTEM.length(100, METRIC_SYSTEM.length_unit) == 100
|
||||
assert METRIC_SYSTEM.length(5, IMPERIAL_SYSTEM.length_unit) == 8.04672
|
||||
assert METRIC_SYSTEM.length(5, IMPERIAL_SYSTEM.length_unit) == pytest.approx(
|
||||
8.04672
|
||||
)
|
||||
|
||||
|
||||
def test_length_to_imperial():
|
||||
"""Test length conversion to imperial system."""
|
||||
assert IMPERIAL_SYSTEM.length(100, IMPERIAL_SYSTEM.length_unit) == 100
|
||||
assert IMPERIAL_SYSTEM.length(5, METRIC_SYSTEM.length_unit) == 3.106855
|
||||
assert IMPERIAL_SYSTEM.length(5, METRIC_SYSTEM.length_unit) == pytest.approx(
|
||||
3.106855
|
||||
)
|
||||
|
||||
|
||||
def test_wind_speed_unknown_unit():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue