mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Panel_Iframe - Allow relative urls in config (#11832)
* Panel_Iframe - Allow relative urls in config * change regex to check for starting forward slash only * Change error message and const name
This commit is contained in:
committed by
Paulus Schoutsen
parent
74b0740e1c
commit
cad0bde95b
@@ -11,11 +11,11 @@ from tests.common import get_test_home_assistant
|
||||
class TestPanelIframe(unittest.TestCase):
|
||||
"""Test the panel_iframe component."""
|
||||
|
||||
def setup_method(self, method):
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def teardown_method(self, method):
|
||||
def tearDown(self):
|
||||
"""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
@@ -50,6 +50,11 @@ class TestPanelIframe(unittest.TestCase):
|
||||
'title': 'Weather',
|
||||
'url': 'https://www.wunderground.com/us/ca/san-diego',
|
||||
},
|
||||
'api': {
|
||||
'icon': 'mdi:weather',
|
||||
'title': 'Api',
|
||||
'url': '/api',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -72,3 +77,12 @@ class TestPanelIframe(unittest.TestCase):
|
||||
'url': '/frontend_es5/panels/ha-panel-iframe-md5md5.html',
|
||||
'url_path': 'weather',
|
||||
}
|
||||
|
||||
assert panels.get('api').to_response(self.hass, None) == {
|
||||
'component_name': 'iframe',
|
||||
'config': {'url': '/api'},
|
||||
'icon': 'mdi:weather',
|
||||
'title': 'Api',
|
||||
'url': '/frontend_es5/panels/ha-panel-iframe-md5md5.html',
|
||||
'url_path': 'api',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user