mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Upgrade black to 20.8b1 (#39287)
This commit is contained in:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user