mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 05:24:53 +01:00
Run black over tests folder (#4824)
This commit is contained in:
parent
1d8227788b
commit
b4c2433bac
3 changed files with 15 additions and 16 deletions
|
@ -37,9 +37,7 @@ def test_button_config_value_internal_set(generate_main):
|
|||
# Given
|
||||
|
||||
# When
|
||||
main_cpp = generate_main(
|
||||
"tests/component_tests/button/test_button.yaml"
|
||||
)
|
||||
main_cpp = generate_main("tests/component_tests/button/test_button.yaml")
|
||||
|
||||
# Then
|
||||
assert "wol_1->set_internal(true);" in main_cpp
|
||||
|
|
|
@ -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
|
||||
"""
|
||||
main_cpp = generate_main(
|
||||
"tests/component_tests/deep_sleep/test_deep_sleep1.yaml"
|
||||
)
|
||||
main_cpp = generate_main("tests/component_tests/deep_sleep/test_deep_sleep1.yaml")
|
||||
|
||||
assert "deepsleep = new deep_sleep::DeepSleepComponent();" 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.
|
||||
"""
|
||||
main_cpp = generate_main(
|
||||
"tests/component_tests/deep_sleep/test_deep_sleep1.yaml"
|
||||
)
|
||||
main_cpp = generate_main("tests/component_tests/deep_sleep/test_deep_sleep1.yaml")
|
||||
|
||||
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.
|
||||
"""
|
||||
main_cpp = generate_main(
|
||||
"tests/component_tests/deep_sleep/test_deep_sleep1.yaml"
|
||||
)
|
||||
main_cpp = generate_main("tests/component_tests/deep_sleep/test_deep_sleep1.yaml")
|
||||
|
||||
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.
|
||||
"""
|
||||
main_cpp = generate_main(
|
||||
"tests/component_tests/deep_sleep/test_deep_sleep2.yaml"
|
||||
)
|
||||
main_cpp = generate_main("tests/component_tests/deep_sleep/test_deep_sleep2.yaml")
|
||||
|
||||
assert (
|
||||
"deepsleep->set_run_duration(deep_sleep::WakeupCauseToRunDuration{\n"
|
||||
|
|
|
@ -66,7 +66,16 @@ def test_string_string__invalid(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("")
|
||||
def test_icon__valid(value):
|
||||
actual = config_validation.icon(value)
|
||||
|
|
Loading…
Reference in a new issue