Add test for incorrect config for Jewish Calendar (#71163)
* Loop load Jewish Calendar platforms * Address review * Add test for incorrect config * add test to sensor platformpull/71215/head
parent
0926470ef0
commit
7c46eb5952
|
@ -4,6 +4,7 @@ from datetime import datetime as dt, timedelta
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components import jewish_calendar
|
from homeassistant.components import jewish_calendar
|
||||||
|
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
|
||||||
from homeassistant.const import STATE_OFF, STATE_ON
|
from homeassistant.const import STATE_OFF, STATE_ON
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
@ -302,3 +303,15 @@ async def test_issur_melacha_sensor_update(
|
||||||
hass.states.get("binary_sensor.test_issur_melacha_in_effect").state
|
hass.states.get("binary_sensor.test_issur_melacha_in_effect").state
|
||||||
== result[1]
|
== result[1]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
async def test_no_discovery_info(hass, caplog):
|
||||||
|
"""Test setup without discovery info."""
|
||||||
|
assert BINARY_SENSOR_DOMAIN not in hass.config.components
|
||||||
|
assert await async_setup_component(
|
||||||
|
hass,
|
||||||
|
BINARY_SENSOR_DOMAIN,
|
||||||
|
{BINARY_SENSOR_DOMAIN: {"platform": jewish_calendar.DOMAIN}},
|
||||||
|
)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
assert BINARY_SENSOR_DOMAIN in hass.config.components
|
||||||
|
|
|
@ -4,6 +4,7 @@ from datetime import datetime as dt, timedelta
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components import jewish_calendar
|
from homeassistant.components import jewish_calendar
|
||||||
|
from homeassistant.components.binary_sensor import DOMAIN as SENSOR_DOMAIN
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
|
@ -639,3 +640,15 @@ async def test_dafyomi_sensor(hass, test_time, result):
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
assert hass.states.get("sensor.test_daf_yomi").state == result
|
assert hass.states.get("sensor.test_daf_yomi").state == result
|
||||||
|
|
||||||
|
|
||||||
|
async def test_no_discovery_info(hass, caplog):
|
||||||
|
"""Test setup without discovery info."""
|
||||||
|
assert SENSOR_DOMAIN not in hass.config.components
|
||||||
|
assert await async_setup_component(
|
||||||
|
hass,
|
||||||
|
SENSOR_DOMAIN,
|
||||||
|
{SENSOR_DOMAIN: {"platform": jewish_calendar.DOMAIN}},
|
||||||
|
)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
assert SENSOR_DOMAIN in hass.config.components
|
||||||
|
|
Loading…
Reference in New Issue