mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Fix PEP257 issues
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
"""
|
||||
tests.components.automation.test_event
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Tests event automation.
|
||||
"""
|
||||
"""The tests for the Event automation."""
|
||||
import unittest
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
@@ -12,22 +7,25 @@ from tests.common import get_test_home_assistant
|
||||
|
||||
|
||||
class TestAutomationEvent(unittest.TestCase):
|
||||
""" Test the event automation. """
|
||||
"""Test the event automation."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.calls = []
|
||||
|
||||
def record_call(service):
|
||||
"""Helper for recording the call."""
|
||||
self.calls.append(service)
|
||||
|
||||
self.hass.services.register('test', 'automation', record_call)
|
||||
|
||||
def tearDown(self): # pylint: disable=invalid-name
|
||||
""" Stop down stuff we started. """
|
||||
""""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
def test_old_config_if_fires_on_event(self):
|
||||
"""."""
|
||||
self.assertTrue(automation.setup(self.hass, {
|
||||
automation.DOMAIN: {
|
||||
'platform': 'event',
|
||||
@@ -41,6 +39,7 @@ class TestAutomationEvent(unittest.TestCase):
|
||||
self.assertEqual(1, len(self.calls))
|
||||
|
||||
def test_old_config_if_fires_on_event_with_data(self):
|
||||
"""Test old configuration ."""
|
||||
self.assertTrue(automation.setup(self.hass, {
|
||||
automation.DOMAIN: {
|
||||
'platform': 'event',
|
||||
@@ -55,6 +54,7 @@ class TestAutomationEvent(unittest.TestCase):
|
||||
self.assertEqual(1, len(self.calls))
|
||||
|
||||
def test_old_config_if_not_fires_if_event_data_not_matches(self):
|
||||
"""test old configuration."""
|
||||
self.assertTrue(automation.setup(self.hass, {
|
||||
automation.DOMAIN: {
|
||||
'platform': 'event',
|
||||
@@ -69,6 +69,7 @@ class TestAutomationEvent(unittest.TestCase):
|
||||
self.assertEqual(0, len(self.calls))
|
||||
|
||||
def test_if_fires_on_event(self):
|
||||
"""Test the firing of events."""
|
||||
self.assertTrue(automation.setup(self.hass, {
|
||||
automation.DOMAIN: {
|
||||
'trigger': {
|
||||
@@ -86,6 +87,7 @@ class TestAutomationEvent(unittest.TestCase):
|
||||
self.assertEqual(1, len(self.calls))
|
||||
|
||||
def test_if_fires_on_event_with_data(self):
|
||||
"""Test the firing of events with data."""
|
||||
self.assertTrue(automation.setup(self.hass, {
|
||||
automation.DOMAIN: {
|
||||
'trigger': {
|
||||
@@ -105,6 +107,7 @@ class TestAutomationEvent(unittest.TestCase):
|
||||
self.assertEqual(1, len(self.calls))
|
||||
|
||||
def test_if_not_fires_if_event_data_not_matches(self):
|
||||
"""Test firing of event if no match."""
|
||||
self.assertTrue(automation.setup(self.hass, {
|
||||
automation.DOMAIN: {
|
||||
'trigger': {
|
||||
|
||||
Reference in New Issue
Block a user