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

@@ -150,9 +150,21 @@ async def test_save_blueprint(hass, aioclient_mock, hass_ws_client):
output_yaml = write_mock.call_args[0][0]
assert output_yaml in (
# pure python dumper will quote the value after !input
"blueprint:\n name: Call service based on event\n domain: automation\n input:\n trigger_event:\n selector:\n text: {}\n service_to_call:\n a_number:\n selector:\n number:\n mode: box\n step: 1.0\n source_url: https://github.com/balloob/home-assistant-config/blob/main/blueprints/automation/motion_light.yaml\ntrigger:\n platform: event\n event_type: !input 'trigger_event'\naction:\n service: !input 'service_to_call'\n entity_id: light.kitchen\n"
"blueprint:\n name: Call service based on event\n domain: automation\n "
" input:\n trigger_event:\n selector:\n text: {}\n "
" service_to_call:\n a_number:\n selector:\n number:\n "
" mode: box\n step: 1.0\n source_url:"
" https://github.com/balloob/home-assistant-config/blob/main/blueprints/automation/motion_light.yaml\ntrigger:\n"
" platform: event\n event_type: !input 'trigger_event'\naction:\n "
" service: !input 'service_to_call'\n entity_id: light.kitchen\n"
# c dumper will not quote the value after !input
"blueprint:\n name: Call service based on event\n domain: automation\n input:\n trigger_event:\n selector:\n text: {}\n service_to_call:\n a_number:\n selector:\n number:\n mode: box\n step: 1.0\n source_url: https://github.com/balloob/home-assistant-config/blob/main/blueprints/automation/motion_light.yaml\ntrigger:\n platform: event\n event_type: !input trigger_event\naction:\n service: !input service_to_call\n entity_id: light.kitchen\n"
"blueprint:\n name: Call service based on event\n domain: automation\n "
" input:\n trigger_event:\n selector:\n text: {}\n "
" service_to_call:\n a_number:\n selector:\n number:\n "
" mode: box\n step: 1.0\n source_url:"
" https://github.com/balloob/home-assistant-config/blob/main/blueprints/automation/motion_light.yaml\ntrigger:\n"
" platform: event\n event_type: !input trigger_event\naction:\n service:"
" !input service_to_call\n entity_id: light.kitchen\n"
)
# Make sure ita parsable and does not raise
assert len(parse_yaml(output_yaml)) > 1