Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bramstroker/homeassistant-powercalc
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstroker committed Oct 22, 2022
2 parents 17eae8d + fe49e9b commit d9f0e3b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tests/power_profile/test_power_profile.py
Expand Up @@ -8,12 +8,16 @@
CONF_POWER,
CalculationStrategy,
)
from custom_components.powercalc.errors import ModelNotSupported, UnsupportedMode, PowercalcSetupError
from custom_components.powercalc.errors import (
ModelNotSupported,
PowercalcSetupError,
UnsupportedMode,
)
from custom_components.powercalc.power_profile.library import ModelInfo, ProfileLibrary
from custom_components.powercalc.power_profile.power_profile import (
DeviceType,
SubProfileSelector,
PowerProfile,
SubProfileSelector,
)

from ..common import get_test_profile_dir
Expand Down Expand Up @@ -111,7 +115,9 @@ async def test_sub_profile_attribute_match(hass: HomeAssistant):
assert selector.select_sub_profile(state) == "b"


async def test_exception_is_raised_when_invalid_sub_profile_matcher_supplied(hass: HomeAssistant):
async def test_exception_is_raised_when_invalid_sub_profile_matcher_supplied(
hass: HomeAssistant,
):
with pytest.raises(PowercalcSetupError):
power_profile = PowerProfile(
hass,
Expand All @@ -120,12 +126,8 @@ async def test_exception_is_raised_when_invalid_sub_profile_matcher_supplied(has
directory=None,
json_data={
"sub_profile_select": {
"matchers": [
{
"type": "invalid_type"
}
],
"default": "henkie"
"matchers": [{"type": "invalid_type"}],
"default": "henkie",
}
},
)
Expand Down

0 comments on commit d9f0e3b

Please sign in to comment.