Ensure HA script and Python script services have a name (#47204)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Philip Allgaier 2021-03-31 15:09:45 +02:00 committed by GitHub
parent bee55a0494
commit 6fe04f40a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 4 deletions

View file

@ -306,6 +306,7 @@ async def test_service_descriptions(hass):
service_descriptions1 = (
"hello:\n"
" name: ABC\n"
" description: Description of hello.py.\n"
" fields:\n"
" fake_param:\n"
@ -333,6 +334,7 @@ async def test_service_descriptions(hass):
assert len(descriptions) == 1
assert descriptions[DOMAIN]["hello"]["name"] == "ABC"
assert descriptions[DOMAIN]["hello"]["description"] == "Description of hello.py."
assert (
descriptions[DOMAIN]["hello"]["fields"]["fake_param"]["description"]
@ -343,6 +345,8 @@ async def test_service_descriptions(hass):
== "This is a test of python_script.hello"
)
# Verify default name = file name
assert descriptions[DOMAIN]["world_beer"]["name"] == "world_beer"
assert descriptions[DOMAIN]["world_beer"]["description"] == ""
assert bool(descriptions[DOMAIN]["world_beer"]["fields"]) is False