From 7c1241c1f84feaeed51cecd23c835bc5165e3454 Mon Sep 17 00:00:00 2001 From: pavoni Date: Mon, 1 Feb 2016 18:30:39 +0000 Subject: [PATCH] Add another test, revise another. Improve coverage. --- tests/components/sensor/test_template.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/components/sensor/test_template.py b/tests/components/sensor/test_template.py index 55657bc0336..cc416e28f4e 100644 --- a/tests/components/sensor/test_template.py +++ b/tests/components/sensor/test_template.py @@ -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': {