Black
This commit is contained in:
1 parent
da05dfe708
commit
4de97abc3a
2676 files changed
+163166
-140084
No files matched your search
@@ -10,13 +10,14 @@ from homeassistant.setup import async_setup_component
|
||||
async def test_config_with_sensor_passed_to_config_entry(hass):
|
||||
"""Test that configured options for a sensor are loaded."""
|
||||
conf = {
|
||||
CONF_SENSOR_ID: '12345abcde',
|
||||
CONF_SENSOR_ID: "12345abcde",
|
||||
CONF_SHOW_ON_MAP: False,
|
||||
CONF_SCAN_INTERVAL: 600,
|
||||
}
|
||||
|
||||
with patch.object(hass, 'config_entries') as mock_config_entries, \
|
||||
patch.object(luftdaten, 'configured_sensors', return_value=[]):
|
||||
with patch.object(hass, "config_entries") as mock_config_entries, patch.object(
|
||||
luftdaten, "configured_sensors", return_value=[]
|
||||
):
|
||||
assert await async_setup_component(hass, DOMAIN, conf) is True
|
||||
|
||||
assert len(mock_config_entries.flow.mock_calls) == 0
|
||||
@@ -24,13 +25,11 @@ async def test_config_with_sensor_passed_to_config_entry(hass):
|
||||
|
||||
async def test_config_already_registered_not_passed_to_config_entry(hass):
|
||||
"""Test that an already registered sensor does not initiate an import."""
|
||||
conf = {
|
||||
CONF_SENSOR_ID: '12345abcde',
|
||||
}
|
||||
conf = {CONF_SENSOR_ID: "12345abcde"}
|
||||
|
||||
with patch.object(hass, 'config_entries') as mock_config_entries, \
|
||||
patch.object(luftdaten, 'configured_sensors',
|
||||
return_value=['12345abcde']):
|
||||
with patch.object(hass, "config_entries") as mock_config_entries, patch.object(
|
||||
luftdaten, "configured_sensors", return_value=["12345abcde"]
|
||||
):
|
||||
assert await async_setup_component(hass, DOMAIN, conf) is True
|
||||
|
||||
assert len(mock_config_entries.flow.mock_calls) == 0
|
||||
Reference in new issue
Block a user