Fixes #10773: Demo Alarm Broken (#10777)

* Fixes #10773: Demo Alarm Broken

* Added test for platform setup

* Remove unused import

* Lint fix

* Rework assert to work with python 3.5
This commit is contained in:
uchagani authored and Paulus Schoutsen committed 2017-11-24 20:30:57 -08:00
1 parent fcc164c31e
commit 2817f03378
2 files changed
+14 -2

No files matched your search

@@ -1,7 +1,9 @@
"""The tests for the manual Alarm Control Panel component."""
from datetime import timedelta
import unittest
from unittest.mock import patch
from unittest.mock import patch, MagicMock
from homeassistant.components.alarm_control_panel import demo
from homeassistant.setup import setup_component
from homeassistant.const import (
@@ -27,6 +29,13 @@ class TestAlarmControlPanelManual(unittest.TestCase):
"""Stop down everything that was started."""
self.hass.stop()
def test_setup_demo_platform(self):
"""Test setup."""
mock = MagicMock()
add_devices = mock.MagicMock()
demo.setup_platform(self.hass, {}, add_devices)
self.assertEquals(add_devices.call_count, 1)
def test_arm_home_no_pending(self):
"""Test arm home method."""
self.assertTrue(setup_component(