Upgrade black to 20.8b1 (#39287)

This commit is contained in:
Franck Nijhof
2020-08-27 13:56:20 +02:00
committed by GitHub
parent 0d7eec710c
commit 1c2ebdf307
574 changed files with 4389 additions and 1725 deletions

View File

@@ -958,20 +958,23 @@ async def test_component_config_exceptions(hass, caplog):
# component.PLATFORM_SCHEMA
caplog.clear()
assert await config_util.async_process_component_config(
hass,
{"test_domain": {"platform": "test_platform"}},
integration=Mock(
domain="test_domain",
get_platform=Mock(return_value=None),
get_component=Mock(
return_value=Mock(
spec=["PLATFORM_SCHEMA_BASE"],
PLATFORM_SCHEMA_BASE=Mock(side_effect=ValueError("broken")),
)
assert (
await config_util.async_process_component_config(
hass,
{"test_domain": {"platform": "test_platform"}},
integration=Mock(
domain="test_domain",
get_platform=Mock(return_value=None),
get_component=Mock(
return_value=Mock(
spec=["PLATFORM_SCHEMA_BASE"],
PLATFORM_SCHEMA_BASE=Mock(side_effect=ValueError("broken")),
)
),
),
),
) == {"test_domain": []}
)
== {"test_domain": []}
)
assert "ValueError: broken" in caplog.text
assert (
"Unknown error validating test_platform platform config with test_domain component platform schema"
@@ -990,15 +993,20 @@ async def test_component_config_exceptions(hass, caplog):
)
),
):
assert await config_util.async_process_component_config(
hass,
{"test_domain": {"platform": "test_platform"}},
integration=Mock(
domain="test_domain",
get_platform=Mock(return_value=None),
get_component=Mock(return_value=Mock(spec=["PLATFORM_SCHEMA_BASE"])),
),
) == {"test_domain": []}
assert (
await config_util.async_process_component_config(
hass,
{"test_domain": {"platform": "test_platform"}},
integration=Mock(
domain="test_domain",
get_platform=Mock(return_value=None),
get_component=Mock(
return_value=Mock(spec=["PLATFORM_SCHEMA_BASE"])
),
),
)
== {"test_domain": []}
)
assert "ValueError: broken" in caplog.text
assert (
"Unknown error validating config for test_platform platform for test_domain component with PLATFORM_SCHEMA"
@@ -1025,7 +1033,11 @@ async def test_component_config_exceptions(hass, caplog):
),
("zone", vol.Schema({vol.Optional("zone"): int}), None),
("zone", vol.Schema({"zone": int}), None),
("not_existing", vol.Schema({vol.Optional("zone", default=dict): dict}), None,),
(
"not_existing",
vol.Schema({vol.Optional("zone", default=dict): dict}),
None,
),
("non_existing", vol.Schema({"zone": int}), None),
("zone", vol.Schema({}), None),
("plex", vol.Schema(vol.All({"plex": {"host": str}})), "dict"),