Fix PEP257 issues

This commit is contained in:
Fabian Affolter committed 2016-03-09 10:25:50 +01:00
1 parent d6eab03a61
commit 9838697d2b
120 files changed
+1447 -1297

No files matched your search

+14 -20
View File
@@ -1,10 +1,4 @@
"""
tests.components.sensor.test_rfxtrx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests Rfxtrx sensor.
"""
"""The tests for the Rfxtrx sensor platform."""
import unittest
@@ -16,25 +10,25 @@ from tests.common import get_test_home_assistant
class TestSensorRfxtrx(unittest.TestCase):
""" Test the Rfxtrx sensor. """
"""Test the Rfxtrx sensor platform."""
def setUp(self):
""" setup hass """
"""Setup things to be run when tests are started."""
self.hass = get_test_home_assistant(0)
def tearDown(self):
""" Stop down stuff we started. """
"""Stop everything that was started."""
rfxtrx_core.RECEIVED_EVT_SUBSCRIBERS = []
rfxtrx_core.RFX_DEVICES = {}
self.hass.stop()
def test_default_config(self):
""" Test with 0 sensors """
"""Test with 0 sensor."""
config = {'devices': {}}
devices = []
def add_dev_callback(devs):
""" callback to add device """
"""Add a callback to add devices."""
for dev in devs:
devices.append(dev)
@@ -42,7 +36,7 @@ class TestSensorRfxtrx(unittest.TestCase):
self.assertEqual(0, len(devices))
def test_one_sensor(self):
""" Test with 1 sensor """
"""Test with 1 sensor."""
config = {'devices':
{'sensor_0502': {
'name': 'Test',
@@ -51,7 +45,7 @@ class TestSensorRfxtrx(unittest.TestCase):
devices = []
def add_dev_callback(devs):
""" callback to add device """
"""Add a callback to add devices."""
for dev in devs:
devices.append(dev)
@@ -69,7 +63,7 @@ class TestSensorRfxtrx(unittest.TestCase):
entity.device_state_attributes)
def test_several_sensors(self):
""" Test with 3 sensors """
"""Test with 3 sensors."""
config = {'devices':
{'sensor_0502': {
'name': 'Test',
@@ -85,7 +79,7 @@ class TestSensorRfxtrx(unittest.TestCase):
devices = []
def add_dev_callback(devs):
""" callback to add device """
"""Add a callback to add devices."""
for dev in devs:
devices.append(dev)
@@ -129,12 +123,12 @@ class TestSensorRfxtrx(unittest.TestCase):
self.assertEqual(3, device_num)
def test_discover_sensor(self):
""" Test with discover of sensor """
"""Test with discovery of sensor."""
config = {'devices': {}}
devices = []
def add_dev_callback(devs):
""" callback to add device """
"""Add a callback to add devices."""
for dev in devs:
devices.append(dev)
@@ -196,12 +190,12 @@ class TestSensorRfxtrx(unittest.TestCase):
self.assertEqual(2, len(devices))
def test_discover_sensor_noautoadd(self):
""" Test with discover of sensor when auto add is False """
"""Test with discover of sensor when auto add is False."""
config = {'automatic_add': False, 'devices': {}}
devices = []
def add_dev_callback(devs):
""" callback to add device """
"""Add a callback to add devices."""
for dev in devs:
devices.append(dev)