Reorganize trigger code (#38655)

This commit is contained in:
Phil Bruckner 2020-08-17 11:54:56 -05:00 committed by GitHub
parent fca071742d
commit ca9dd0c833
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 306 additions and 194 deletions

View file

@ -0,0 +1,12 @@
"""The tests for the trigger helper."""
import pytest
import voluptuous as vol
from homeassistant.helpers.trigger import async_validate_trigger_config
async def test_bad_trigger_platform(hass):
"""Test bad trigger platform."""
with pytest.raises(vol.Invalid) as ex:
await async_validate_trigger_config(hass, [{"platform": "not_a_platform"}])
assert "Invalid platform 'not_a_platform' specified" in str(ex)