Rename Hass.io -> Supervisor (#1522)

* Rename Hass.io -> Supervisor

* part 2

* fix lint

* fix auth name
This commit is contained in:
Pascal Vizeli
2020-02-21 17:55:41 +01:00
committed by GitHub
parent e9f5b13aa5
commit 4ac7f7dcf0
201 changed files with 244 additions and 246 deletions

View File

@@ -1,6 +1,6 @@
"""Test validators."""
import hassio.validate
import supervisor.validate
import voluptuous.error
import pytest
@@ -20,42 +20,42 @@ BAD = ["hello world", "https://foo.bar", "", "dns://example.com"]
async def test_dns_url_v4_good():
""" tests the DNS validator with known-good ipv6 DNS URLs """
for url in GOOD_V4:
assert hassio.validate.dns_url(url)
assert supervisor.validate.dns_url(url)
async def test_dns_url_v6_good():
""" tests the DNS validator with known-good ipv6 DNS URLs """
for url in GOOD_V6:
assert hassio.validate.dns_url(url)
assert supervisor.validate.dns_url(url)
async def test_dns_server_list_v4():
""" test a list with v4 addresses """
assert hassio.validate.dns_server_list(GOOD_V4)
assert supervisor.validate.dns_server_list(GOOD_V4)
async def test_dns_server_list_v6():
""" test a list with v6 addresses """
assert hassio.validate.dns_server_list(GOOD_V6)
assert supervisor.validate.dns_server_list(GOOD_V6)
async def test_dns_server_list_combined():
""" test a list with both v4 and v6 addresses """
combined = GOOD_V4 + GOOD_V6
# test the matches
assert hassio.validate.dns_server_list(combined)
assert supervisor.validate.dns_server_list(combined)
# test max_length is OK still
assert hassio.validate.dns_server_list(combined)
assert supervisor.validate.dns_server_list(combined)
# test that it fails when the list is too long
with pytest.raises(voluptuous.error.Invalid):
hassio.validate.dns_server_list(combined + combined + combined + combined)
supervisor.validate.dns_server_list(combined + combined + combined + combined)
async def test_dns_server_list_bad():
""" test the bad list """
# test the matches
with pytest.raises(voluptuous.error.Invalid):
assert hassio.validate.dns_server_list(BAD)
assert supervisor.validate.dns_server_list(BAD)
async def test_dns_server_list_bad_combined():
@@ -64,4 +64,4 @@ async def test_dns_server_list_bad_combined():
with pytest.raises(voluptuous.error.Invalid):
# bad list
assert hassio.validate.dns_server_list(combined)
assert supervisor.validate.dns_server_list(combined)