mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Code styling tweaks to the tests - Part 1 (#86192)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user