1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 05:57:01 +00:00

Code styling tweaks to the tests - Part 1 (#86192)

This commit is contained in:
Franck Nijhof
2023-01-20 13:52:46 +01:00
committed by GitHub
parent 79b52a2b41
commit 24fdd588fd
50 changed files with 552 additions and 251 deletions

View File

@@ -1177,9 +1177,9 @@ async def test_component_config_exceptions(hass, caplog):
) == {"test_domain": []}
assert "ValueError: broken" in caplog.text
assert (
"Unknown error validating test_platform platform config with test_domain component platform schema"
in caplog.text
)
"Unknown error validating test_platform platform config "
"with test_domain component platform schema"
) in caplog.text
# platform.PLATFORM_SCHEMA
caplog.clear()
@@ -1204,8 +1204,8 @@ async def test_component_config_exceptions(hass, caplog):
) == {"test_domain": []}
assert "ValueError: broken" in caplog.text
assert (
"Unknown error validating config for test_platform platform for test_domain component with PLATFORM_SCHEMA"
in caplog.text
"Unknown error validating config for test_platform platform for test_domain"
" component with PLATFORM_SCHEMA" in caplog.text
)
# get_platform("config") raising
@@ -1219,7 +1219,10 @@ async def test_component_config_exceptions(hass, caplog):
domain="test_domain",
get_platform=Mock(
side_effect=ImportError(
"ModuleNotFoundError: No module named 'not_installed_something'",
(
"ModuleNotFoundError: No module named"
" 'not_installed_something'"
),
name="not_installed_something",
)
),
@@ -1228,8 +1231,8 @@ async def test_component_config_exceptions(hass, caplog):
is None
)
assert (
"Error importing config platform test_domain: ModuleNotFoundError: No module named 'not_installed_something'"
in caplog.text
"Error importing config platform test_domain: ModuleNotFoundError: No module"
" named 'not_installed_something'" in caplog.text
)
# get_component raising