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:
19
tests/discovery/test_adguard.py
Normal file
19
tests/discovery/test_adguard.py
Normal 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"})
|
||||
14
tests/utils/test_check_port.py
Normal file
14
tests/utils/test_check_port.py
Normal 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)
|
||||
Reference in New Issue
Block a user