1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-04-18 07:35:22 +01:00

Support pip progress for HA 0.94 (#1113)

* Support pip progress for HA 0.94

* fix black

* add tests

* add test for adguard

* Fix lint
This commit is contained in:
Pascal Vizeli
2019-06-05 14:46:03 +02:00
committed by GitHub
parent eb604ed92d
commit 0a0d97b084
4 changed files with 73 additions and 19 deletions

View File

@@ -0,0 +1,19 @@
"""Test adguard discovery."""
import voluptuous as vol
import pytest
from hassio.discovery.validate import valid_discovery_config
def test_good_config():
"""Test good deconz config."""
valid_discovery_config("adguard", {"host": "test", "port": 3812})
def test_bad_config():
"""Test good adguard config."""
with pytest.raises(vol.Invalid):
valid_discovery_config("adguard", {"host": "test"})

View File

@@ -0,0 +1,14 @@
"""Check ports."""
from ipaddress import ip_address
from hassio.utils import check_port
def test_exists_open_port():
"""Test a exists network port."""
assert check_port(ip_address("8.8.8.8"), 53)
def test_not_exists_port():
"""Test a not exists network service."""
assert not check_port(ip_address("192.0.2.1"), 53)