diff --git a/homeassistant/test.py b/homeassistant/test.py index 180eb4cd83a..c141a6a9946 100644 --- a/homeassistant/test.py +++ b/homeassistant/test.py @@ -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 - +import re import os import unittest import time @@ -464,6 +464,22 @@ class TestHTTP(unittest.TestCase): """ things to be run when tests are 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\/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): """ Test if we get access denied if we omit or provide a wrong api password. """