mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Use correct enum in UnitSystem tests (#122256)
This commit is contained in:
parent
5e8b022246
commit
90e7d82049
@ -15,6 +15,7 @@ from homeassistant.const import (
|
|||||||
WIND_SPEED,
|
WIND_SPEED,
|
||||||
UnitOfLength,
|
UnitOfLength,
|
||||||
UnitOfMass,
|
UnitOfMass,
|
||||||
|
UnitOfPrecipitationDepth,
|
||||||
UnitOfPressure,
|
UnitOfPressure,
|
||||||
UnitOfSpeed,
|
UnitOfSpeed,
|
||||||
UnitOfTemperature,
|
UnitOfTemperature,
|
||||||
@ -42,7 +43,7 @@ def test_invalid_units() -> None:
|
|||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
UnitSystem(
|
UnitSystem(
|
||||||
SYSTEM_NAME,
|
SYSTEM_NAME,
|
||||||
accumulated_precipitation=UnitOfLength.MILLIMETERS,
|
accumulated_precipitation=UnitOfPrecipitationDepth.MILLIMETERS,
|
||||||
conversions={},
|
conversions={},
|
||||||
length=UnitOfLength.METERS,
|
length=UnitOfLength.METERS,
|
||||||
mass=UnitOfMass.GRAMS,
|
mass=UnitOfMass.GRAMS,
|
||||||
@ -55,7 +56,7 @@ def test_invalid_units() -> None:
|
|||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
UnitSystem(
|
UnitSystem(
|
||||||
SYSTEM_NAME,
|
SYSTEM_NAME,
|
||||||
accumulated_precipitation=UnitOfLength.MILLIMETERS,
|
accumulated_precipitation=UnitOfPrecipitationDepth.MILLIMETERS,
|
||||||
conversions={},
|
conversions={},
|
||||||
length=INVALID_UNIT,
|
length=INVALID_UNIT,
|
||||||
mass=UnitOfMass.GRAMS,
|
mass=UnitOfMass.GRAMS,
|
||||||
@ -68,7 +69,7 @@ def test_invalid_units() -> None:
|
|||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
UnitSystem(
|
UnitSystem(
|
||||||
SYSTEM_NAME,
|
SYSTEM_NAME,
|
||||||
accumulated_precipitation=UnitOfLength.MILLIMETERS,
|
accumulated_precipitation=UnitOfPrecipitationDepth.MILLIMETERS,
|
||||||
conversions={},
|
conversions={},
|
||||||
length=UnitOfLength.METERS,
|
length=UnitOfLength.METERS,
|
||||||
mass=UnitOfMass.GRAMS,
|
mass=UnitOfMass.GRAMS,
|
||||||
@ -81,7 +82,7 @@ def test_invalid_units() -> None:
|
|||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
UnitSystem(
|
UnitSystem(
|
||||||
SYSTEM_NAME,
|
SYSTEM_NAME,
|
||||||
accumulated_precipitation=UnitOfLength.MILLIMETERS,
|
accumulated_precipitation=UnitOfPrecipitationDepth.MILLIMETERS,
|
||||||
conversions={},
|
conversions={},
|
||||||
length=UnitOfLength.METERS,
|
length=UnitOfLength.METERS,
|
||||||
mass=UnitOfMass.GRAMS,
|
mass=UnitOfMass.GRAMS,
|
||||||
@ -94,7 +95,7 @@ def test_invalid_units() -> None:
|
|||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
UnitSystem(
|
UnitSystem(
|
||||||
SYSTEM_NAME,
|
SYSTEM_NAME,
|
||||||
accumulated_precipitation=UnitOfLength.MILLIMETERS,
|
accumulated_precipitation=UnitOfPrecipitationDepth.MILLIMETERS,
|
||||||
conversions={},
|
conversions={},
|
||||||
length=UnitOfLength.METERS,
|
length=UnitOfLength.METERS,
|
||||||
mass=INVALID_UNIT,
|
mass=INVALID_UNIT,
|
||||||
@ -107,7 +108,7 @@ def test_invalid_units() -> None:
|
|||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
UnitSystem(
|
UnitSystem(
|
||||||
SYSTEM_NAME,
|
SYSTEM_NAME,
|
||||||
accumulated_precipitation=UnitOfLength.MILLIMETERS,
|
accumulated_precipitation=UnitOfPrecipitationDepth.MILLIMETERS,
|
||||||
conversions={},
|
conversions={},
|
||||||
length=UnitOfLength.METERS,
|
length=UnitOfLength.METERS,
|
||||||
mass=UnitOfMass.GRAMS,
|
mass=UnitOfMass.GRAMS,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user