Fix PEP257 issues
This commit is contained in:
1 parent
d6eab03a61
commit
9838697d2b
120 files changed
+1447
-1297
No files matched your search
@@ -0,0 +1 @@
|
||||
"""The tests for notification platforms."""
|
||||
@@ -1,9 +1,4 @@
|
||||
"""
|
||||
tests.components.notify.test_command_line
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Tests command line notification.
|
||||
"""
|
||||
"""The tests for the command line notification platform."""
|
||||
import os
|
||||
import tempfile
|
||||
import unittest
|
||||
@@ -14,16 +9,18 @@ from unittest.mock import patch
|
||||
|
||||
|
||||
class TestCommandLine(unittest.TestCase):
|
||||
""" Test the command line. """
|
||||
"""Test the command line notifications."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = core.HomeAssistant()
|
||||
|
||||
def tearDown(self): # pylint: disable=invalid-name
|
||||
""" Stop down stuff we started. """
|
||||
"""Stop down everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
def test_command_line_output(self):
|
||||
"""Test the command line output."""
|
||||
with tempfile.TemporaryDirectory() as tempdirname:
|
||||
filename = os.path.join(tempdirname, 'message.txt')
|
||||
message = 'one, two, testing, testing'
|
||||
@@ -44,7 +41,7 @@ class TestCommandLine(unittest.TestCase):
|
||||
|
||||
@patch('homeassistant.components.notify.command_line._LOGGER.error')
|
||||
def test_error_for_none_zero_exit_code(self, mock_error):
|
||||
""" Test if an error if logged for non zero exit codes. """
|
||||
"""Test if an error if logged for non zero exit codes."""
|
||||
self.assertTrue(notify.setup(self.hass, {
|
||||
'notify': {
|
||||
'name': 'test',
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
"""
|
||||
tests.components.notify.test_demo
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Tests notify demo component.
|
||||
"""
|
||||
"""The tests for the notify demo platform."""
|
||||
import unittest
|
||||
|
||||
import homeassistant.components.notify as notify
|
||||
@@ -13,9 +8,10 @@ from tests.common import get_test_home_assistant
|
||||
|
||||
|
||||
class TestNotifyDemo(unittest.TestCase):
|
||||
""" Test the demo notify. """
|
||||
"""Test the demo notify."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.assertTrue(notify.setup(self.hass, {
|
||||
'notify': {
|
||||
@@ -25,15 +21,17 @@ class TestNotifyDemo(unittest.TestCase):
|
||||
self.events = []
|
||||
|
||||
def record_event(event):
|
||||
"""Record event to send notification."""
|
||||
self.events.append(event)
|
||||
|
||||
self.hass.bus.listen(demo.EVENT_NOTIFY, record_event)
|
||||
|
||||
def tearDown(self): # pylint: disable=invalid-name
|
||||
""" Stop down stuff we started. """
|
||||
""""Stop down everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
def test_sending_templated_message(self):
|
||||
"""Send a templated message."""
|
||||
self.hass.states.set('sensor.temperature', 10)
|
||||
notify.send_message(self.hass, '{{ states.sensor.temperature.state }}',
|
||||
'{{ states.sensor.temperature.name }}')
|
||||
|
||||
Reference in new issue
Block a user