mirror of
https://github.com/home-assistant/supervisor
synced 2024-08-05 03:49:58 +02:00
1d83c0c77a
* 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)
|