Update HTTP defaults (#25702)

* Update HTTP defaults

* Fix tests
This commit is contained in:
Paulus Schoutsen
2019-08-06 08:58:59 -07:00
parent eceef82ffa
commit fee1568a85
4 changed files with 16 additions and 2 deletions
+9
View File
@@ -232,3 +232,12 @@ async def test_ssl_profile_change_modern(hass):
await hass.async_block_till_done()
assert len(mock_context.mock_calls) == 1
async def test_cors_defaults(hass):
"""Test the CORS default settings."""
with patch("homeassistant.components.http.setup_cors") as mock_setup:
assert await async_setup_component(hass, "http", {})
assert len(mock_setup.mock_calls) == 1
assert mock_setup.mock_calls[0][1][1] == ["https://cast.home-assistant.io"]
+1 -1
View File
@@ -103,7 +103,7 @@ def test_secrets(isfile_patch, loop):
assert res["components"].keys() == {"homeassistant", "http"}
assert res["components"]["http"] == {
"api_password": "abc123",
"cors_allowed_origins": [],
"cors_allowed_origins": ["https://cast.home-assistant.io"],
"ip_ban_enabled": True,
"login_attempts_threshold": -1,
"server_host": "0.0.0.0",