mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Ensure internal/external URL have no path (#54304)
* Ensure internal/external URL have no path * Fix comment typo Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
@@ -120,6 +120,25 @@ def test_url():
|
||||
assert schema(value)
|
||||
|
||||
|
||||
def test_url_no_path():
|
||||
"""Test URL."""
|
||||
schema = vol.Schema(cv.url_no_path)
|
||||
|
||||
for value in (
|
||||
"https://localhost/test/index.html",
|
||||
"http://home-assistant.io/test/",
|
||||
):
|
||||
with pytest.raises(vol.MultipleInvalid):
|
||||
schema(value)
|
||||
|
||||
for value in (
|
||||
"http://localhost",
|
||||
"http://home-assistant.io",
|
||||
"https://community.home-assistant.io/",
|
||||
):
|
||||
assert schema(value)
|
||||
|
||||
|
||||
def test_platform_config():
|
||||
"""Test platform config validation."""
|
||||
options = ({}, {"hello": "world"})
|
||||
|
||||
Reference in New Issue
Block a user