mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-04-27 02:42:42 +00:00
22 lines
491 B
Python
22 lines
491 B
Python
"""Test MQTT discovery."""
|
|
|
|
import voluptuous as vol
|
|
import pytest
|
|
|
|
from supervisor.discovery.validate import valid_discovery_config
|
|
|
|
|
|
def test_good_config():
|
|
"""Test good mqtt config."""
|
|
|
|
valid_discovery_config(
|
|
"mqtt", {"host": "test", "port": 3812, "username": "bla", "ssl": True}
|
|
)
|
|
|
|
|
|
def test_bad_config():
|
|
"""Test good mqtt config."""
|
|
|
|
with pytest.raises(vol.Invalid):
|
|
valid_discovery_config("mqtt", {"host": "test", "username": "bla", "ssl": True})
|