mirror of
https://github.com/home-assistant/core.git
synced 2025-08-28 14:50:05 +00:00
Ensure HA script and Python script services have a name (#47204)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user