mirror of
https://github.com/elisspace/core.git
synced 2026-09-29 05:49:53 +00:00
Makes sure YAML defined tariffs are unique (#69151)
This commit is contained in:
@@ -226,6 +226,27 @@ async def test_state(hass, yaml_config, config_entry_config):
|
||||
assert state.state == "0.123"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"yaml_config",
|
||||
(
|
||||
(
|
||||
{
|
||||
"utility_meter": {
|
||||
"energy_bill": {
|
||||
"source": "sensor.energy",
|
||||
"tariffs": ["onpeak", "onpeak"],
|
||||
}
|
||||
}
|
||||
},
|
||||
None,
|
||||
),
|
||||
),
|
||||
)
|
||||
async def test_not_unique_tariffs(hass, yaml_config):
|
||||
"""Test utility sensor state initializtion."""
|
||||
assert not await async_setup_component(hass, DOMAIN, yaml_config)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"yaml_config,config_entry_config",
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user