mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Added test to validate frontend loads
This commit is contained in:
parent
e5be72e445
commit
ec59c3c793
@ -6,7 +6,7 @@ Provides tests to verify that Home Assistant modules do what they should do.
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
# pylint: disable=protected-access,too-many-public-methods
|
# pylint: disable=protected-access,too-many-public-methods
|
||||||
|
import re
|
||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
import time
|
import time
|
||||||
@ -464,6 +464,22 @@ class TestHTTP(unittest.TestCase):
|
|||||||
""" things to be run when tests are started. """
|
""" things to be run when tests are started. """
|
||||||
cls.hass = ensure_homeassistant_started()
|
cls.hass = ensure_homeassistant_started()
|
||||||
|
|
||||||
|
def test_get_frontend(self):
|
||||||
|
""" Tests if we can get the frontend. """
|
||||||
|
req = requests.get(_url(""))
|
||||||
|
|
||||||
|
self.assertEqual(200, req.status_code)
|
||||||
|
|
||||||
|
frontendjs = re.search(
|
||||||
|
r'(?P<app>\/static\/frontend-[A-Za-z0-9]{32}.html)',
|
||||||
|
req.text).groups(0)[0]
|
||||||
|
|
||||||
|
self.assertIsNotNone(frontendjs)
|
||||||
|
|
||||||
|
req = requests.get(_url(frontendjs))
|
||||||
|
|
||||||
|
self.assertEqual(200, req.status_code)
|
||||||
|
|
||||||
def test_api_password(self):
|
def test_api_password(self):
|
||||||
""" Test if we get access denied if we omit or provide
|
""" Test if we get access denied if we omit or provide
|
||||||
a wrong api password. """
|
a wrong api password. """
|
||||||
|
Loading…
x
Reference in New Issue
Block a user