Ensure HA script and Python script services have a name (#47204)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
bee55a0494
commit
6fe04f40a2
6 changed files with 39 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue