mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Add another test, revise another. Improve coverage.
This commit is contained in:
parent
d54e10e54a
commit
7c1241c1f8
@ -72,17 +72,25 @@ class TestTemplateSensor:
|
|||||||
})
|
})
|
||||||
assert self.hass.states.all() == []
|
assert self.hass.states.all() == []
|
||||||
|
|
||||||
def test_invalid_config_does_not_create(self):
|
def test_invalid_sensor_does_not_create(self):
|
||||||
assert sensor.setup(self.hass, {
|
assert sensor.setup(self.hass, {
|
||||||
'sensor': {
|
'sensor': {
|
||||||
'platform': 'template',
|
'platform': 'template',
|
||||||
'sensors': {
|
'sensors': {
|
||||||
'test_template_sensor': {}
|
'test_template_sensor': 'invalid'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
assert self.hass.states.all() == []
|
assert self.hass.states.all() == []
|
||||||
|
|
||||||
|
def test_no_sensors_does_not_create(self):
|
||||||
|
assert sensor.setup(self.hass, {
|
||||||
|
'sensor': {
|
||||||
|
'platform': 'template'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
assert self.hass.states.all() == []
|
||||||
|
|
||||||
def test_missing_template_does_not_create(self):
|
def test_missing_template_does_not_create(self):
|
||||||
assert sensor.setup(self.hass, {
|
assert sensor.setup(self.hass, {
|
||||||
'sensor': {
|
'sensor': {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user