Add another test, revise another. Improve coverage.

This commit is contained in:
pavoni 2016-02-01 18:30:39 +00:00
parent d54e10e54a
commit 7c1241c1f8

View File

@ -72,17 +72,25 @@ class TestTemplateSensor:
})
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, {
'sensor': {
'platform': 'template',
'sensors': {
'test_template_sensor': {}
'test_template_sensor': 'invalid'
}
}
})
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):
assert sensor.setup(self.hass, {
'sensor': {