mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-02-21 02:09:44 +00:00
* Add known first party to isort configuration * Run isort on supervisor and tests folder
22 lines
503 B
Python
22 lines
503 B
Python
"""Test validate of discovery."""
|
|
|
|
import pytest
|
|
import voluptuous as vol
|
|
|
|
from supervisor.discovery import validate
|
|
|
|
|
|
def test_valid_services():
|
|
"""Validate that service is valid."""
|
|
|
|
for service in ("mqtt", "deconz"):
|
|
validate.valid_discovery_service(service)
|
|
|
|
|
|
def test_invalid_services():
|
|
"""Test that validate is invalid for a service."""
|
|
|
|
for service in ("fadsfasd", "203432"):
|
|
with pytest.raises(vol.Invalid):
|
|
validate.valid_discovery_service(service)
|