Run black over tests folder (#4824)

This commit is contained in:
Jesse Hills 2023-05-15 16:09:56 +12:00 committed by GitHub
parent 1d8227788b
commit b4c2433bac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 16 deletions

View file

@ -37,9 +37,7 @@ def test_button_config_value_internal_set(generate_main):
# Given # Given
# When # When
main_cpp = generate_main( main_cpp = generate_main("tests/component_tests/button/test_button.yaml")
"tests/component_tests/button/test_button.yaml"
)
# Then # Then
assert "wol_1->set_internal(true);" in main_cpp assert "wol_1->set_internal(true);" in main_cpp

View file

@ -5,9 +5,7 @@ def test_deep_sleep_setup(generate_main):
""" """
When the deep sleep is set in the yaml file, it should be registered in main When the deep sleep is set in the yaml file, it should be registered in main
""" """
main_cpp = generate_main( main_cpp = generate_main("tests/component_tests/deep_sleep/test_deep_sleep1.yaml")
"tests/component_tests/deep_sleep/test_deep_sleep1.yaml"
)
assert "deepsleep = new deep_sleep::DeepSleepComponent();" in main_cpp assert "deepsleep = new deep_sleep::DeepSleepComponent();" in main_cpp
assert "App.register_component(deepsleep);" in main_cpp assert "App.register_component(deepsleep);" in main_cpp
@ -17,9 +15,7 @@ def test_deep_sleep_sleep_duration(generate_main):
""" """
When deep sleep is configured with sleep duration, it should be set. When deep sleep is configured with sleep duration, it should be set.
""" """
main_cpp = generate_main( main_cpp = generate_main("tests/component_tests/deep_sleep/test_deep_sleep1.yaml")
"tests/component_tests/deep_sleep/test_deep_sleep1.yaml"
)
assert "deepsleep->set_sleep_duration(60000);" in main_cpp assert "deepsleep->set_sleep_duration(60000);" in main_cpp
@ -28,9 +24,7 @@ def test_deep_sleep_run_duration_simple(generate_main):
""" """
When deep sleep is configured with run duration, it should be set. When deep sleep is configured with run duration, it should be set.
""" """
main_cpp = generate_main( main_cpp = generate_main("tests/component_tests/deep_sleep/test_deep_sleep1.yaml")
"tests/component_tests/deep_sleep/test_deep_sleep1.yaml"
)
assert "deepsleep->set_run_duration(10000);" in main_cpp assert "deepsleep->set_run_duration(10000);" in main_cpp
@ -39,9 +33,7 @@ def test_deep_sleep_run_duration_dictionary(generate_main):
""" """
When deep sleep is configured with dictionary run duration, it should be set. When deep sleep is configured with dictionary run duration, it should be set.
""" """
main_cpp = generate_main( main_cpp = generate_main("tests/component_tests/deep_sleep/test_deep_sleep2.yaml")
"tests/component_tests/deep_sleep/test_deep_sleep2.yaml"
)
assert ( assert (
"deepsleep->set_run_duration(deep_sleep::WakeupCauseToRunDuration{\n" "deepsleep->set_run_duration(deep_sleep::WakeupCauseToRunDuration{\n"

View file

@ -66,7 +66,16 @@ def test_string_string__invalid(value):
config_validation.string_strict(value) config_validation.string_strict(value)
@given(builds(lambda v: "mdi:" + v, text(alphabet=string.ascii_letters + string.digits + "-_", min_size=1, max_size=20))) @given(
builds(
lambda v: "mdi:" + v,
text(
alphabet=string.ascii_letters + string.digits + "-_",
min_size=1,
max_size=20,
),
)
)
@example("") @example("")
def test_icon__valid(value): def test_icon__valid(value):
actual = config_validation.icon(value) actual = config_validation.icon(value)