Upgrade black to 20.8b1 (#39287)
This commit is contained in:
1 parent
0d7eec710c
commit
1c2ebdf307
574 files changed
+4389
-1725
No files matched your search
@@ -346,7 +346,9 @@ async def test_invalid_panel_does_not_create(hass, caplog):
|
||||
async def test_no_panels_does_not_create(hass, caplog):
|
||||
"""Test if there are no panels -> no creation."""
|
||||
await setup.async_setup_component(
|
||||
hass, "alarm_control_panel", {"alarm_control_panel": {"platform": "template"}},
|
||||
hass,
|
||||
"alarm_control_panel",
|
||||
{"alarm_control_panel": {"platform": "template"}},
|
||||
)
|
||||
|
||||
await hass.async_block_till_done()
|
||||
|
||||
@@ -34,11 +34,16 @@ async def test_reloadable(hass):
|
||||
assert len(hass.states.async_all()) == 2
|
||||
|
||||
yaml_path = path.join(
|
||||
_get_fixtures_base_path(), "fixtures", "template/sensor_configuration.yaml",
|
||||
_get_fixtures_base_path(),
|
||||
"fixtures",
|
||||
"template/sensor_configuration.yaml",
|
||||
)
|
||||
with patch.object(config, "YAML_CONFIG_FILE", yaml_path):
|
||||
await hass.services.async_call(
|
||||
DOMAIN, SERVICE_RELOAD, {}, blocking=True,
|
||||
DOMAIN,
|
||||
SERVICE_RELOAD,
|
||||
{},
|
||||
blocking=True,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
@@ -76,11 +81,16 @@ async def test_reloadable_can_remove(hass):
|
||||
assert len(hass.states.async_all()) == 2
|
||||
|
||||
yaml_path = path.join(
|
||||
_get_fixtures_base_path(), "fixtures", "template/empty_configuration.yaml",
|
||||
_get_fixtures_base_path(),
|
||||
"fixtures",
|
||||
"template/empty_configuration.yaml",
|
||||
)
|
||||
with patch.object(config, "YAML_CONFIG_FILE", yaml_path):
|
||||
await hass.services.async_call(
|
||||
DOMAIN, SERVICE_RELOAD, {}, blocking=True,
|
||||
DOMAIN,
|
||||
SERVICE_RELOAD,
|
||||
{},
|
||||
blocking=True,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
@@ -115,11 +125,16 @@ async def test_reloadable_stops_on_invalid_config(hass):
|
||||
assert len(hass.states.async_all()) == 2
|
||||
|
||||
yaml_path = path.join(
|
||||
_get_fixtures_base_path(), "fixtures", "template/configuration.yaml.corrupt",
|
||||
_get_fixtures_base_path(),
|
||||
"fixtures",
|
||||
"template/configuration.yaml.corrupt",
|
||||
)
|
||||
with patch.object(config, "YAML_CONFIG_FILE", yaml_path):
|
||||
await hass.services.async_call(
|
||||
DOMAIN, SERVICE_RELOAD, {}, blocking=True,
|
||||
DOMAIN,
|
||||
SERVICE_RELOAD,
|
||||
{},
|
||||
blocking=True,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
@@ -155,11 +170,16 @@ async def test_reloadable_handles_partial_valid_config(hass):
|
||||
assert len(hass.states.async_all()) == 2
|
||||
|
||||
yaml_path = path.join(
|
||||
_get_fixtures_base_path(), "fixtures", "template/broken_configuration.yaml",
|
||||
_get_fixtures_base_path(),
|
||||
"fixtures",
|
||||
"template/broken_configuration.yaml",
|
||||
)
|
||||
with patch.object(config, "YAML_CONFIG_FILE", yaml_path):
|
||||
await hass.services.async_call(
|
||||
DOMAIN, SERVICE_RELOAD, {}, blocking=True,
|
||||
DOMAIN,
|
||||
SERVICE_RELOAD,
|
||||
{},
|
||||
blocking=True,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
@@ -213,11 +233,16 @@ async def test_reloadable_multiple_platforms(hass):
|
||||
assert len(hass.states.async_all()) == 3
|
||||
|
||||
yaml_path = path.join(
|
||||
_get_fixtures_base_path(), "fixtures", "template/sensor_configuration.yaml",
|
||||
_get_fixtures_base_path(),
|
||||
"fixtures",
|
||||
"template/sensor_configuration.yaml",
|
||||
)
|
||||
with patch.object(config, "YAML_CONFIG_FILE", yaml_path):
|
||||
await hass.services.async_call(
|
||||
DOMAIN, SERVICE_RELOAD, {}, blocking=True,
|
||||
DOMAIN,
|
||||
SERVICE_RELOAD,
|
||||
{},
|
||||
blocking=True,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
||||
@@ -472,7 +472,8 @@ async def test_creating_sensor_loads_group(hass):
|
||||
hass.bus.async_listen(EVENT_COMPONENT_LOADED, set_after_dep_event)
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.group.async_setup", new=async_setup_group,
|
||||
"homeassistant.components.group.async_setup",
|
||||
new=async_setup_group,
|
||||
), patch(
|
||||
"homeassistant.components.template.sensor.async_setup_platform",
|
||||
new=async_setup_template,
|
||||
|
||||
@@ -541,7 +541,11 @@ async def test_off_action_optimistic(hass, calls):
|
||||
async def test_restore_state(hass):
|
||||
"""Test state restoration."""
|
||||
mock_restore_cache(
|
||||
hass, (State("switch.s1", STATE_ON), State("switch.s2", STATE_OFF),),
|
||||
hass,
|
||||
(
|
||||
State("switch.s1", STATE_ON),
|
||||
State("switch.s2", STATE_OFF),
|
||||
),
|
||||
)
|
||||
|
||||
hass.state = CoreState.starting
|
||||
|
||||
Reference in new issue
Block a user