Update for file header, docstrings, and PEP8/PEP257
This commit is contained in:
1 parent
34b91cf6ce
commit
00afaac54c
74 files changed
+212
-211
No files matched your search
@@ -1,6 +1,6 @@
|
||||
"""
|
||||
tests.components.switch.test_command_switch
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Tests command switch.
|
||||
"""
|
||||
@@ -55,7 +55,6 @@ class TestCommandSwitch(unittest.TestCase):
|
||||
state = self.hass.states.get('switch.test')
|
||||
self.assertEqual(STATE_OFF, state.state)
|
||||
|
||||
|
||||
def test_state_value(self):
|
||||
with tempfile.TemporaryDirectory() as tempdirname:
|
||||
path = os.path.join(tempdirname, 'switch_status')
|
||||
@@ -79,7 +78,7 @@ class TestCommandSwitch(unittest.TestCase):
|
||||
|
||||
switch.turn_on(self.hass, 'switch.test')
|
||||
self.hass.pool.block_till_done()
|
||||
|
||||
|
||||
state = self.hass.states.get('switch.test')
|
||||
self.assertEqual(STATE_ON, state.state)
|
||||
|
||||
@@ -89,7 +88,6 @@ class TestCommandSwitch(unittest.TestCase):
|
||||
state = self.hass.states.get('switch.test')
|
||||
self.assertEqual(STATE_OFF, state.state)
|
||||
|
||||
|
||||
def test_state_json_value(self):
|
||||
with tempfile.TemporaryDirectory() as tempdirname:
|
||||
path = os.path.join(tempdirname, 'switch_status')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""
|
||||
tests.test_component_switch
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
tests.components.switch.test_init
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Tests switch component.
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""
|
||||
tests.components.switch.test_mfi
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Tests mFi switch.
|
||||
"""
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
tests.components.switch.test_mqtt
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Tests mqtt switch.
|
||||
Tests MQTT switch.
|
||||
"""
|
||||
import unittest
|
||||
|
||||
@@ -107,4 +107,4 @@ class TestSensorMQTT(unittest.TestCase):
|
||||
self.hass.pool.block_till_done()
|
||||
|
||||
state = self.hass.states.get('switch.test')
|
||||
self.assertEqual(STATE_OFF, state.state)
|
||||
self.assertEqual(STATE_OFF, state.state)
|
||||
@@ -1,10 +1,9 @@
|
||||
"""
|
||||
tests.components.switch.template
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Tests template switch.
|
||||
"""
|
||||
|
||||
import homeassistant.core as ha
|
||||
import homeassistant.components as core
|
||||
import homeassistant.components.switch as switch
|
||||
@@ -27,7 +26,6 @@ class TestTemplateSwitch:
|
||||
|
||||
self.hass.services.register('test', 'automation', record_call)
|
||||
|
||||
|
||||
def teardown_method(self, method):
|
||||
""" Stop down stuff we started. """
|
||||
self.hass.stop()
|
||||
@@ -53,7 +51,6 @@ class TestTemplateSwitch:
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
state = self.hass.states.set('switch.test_state', STATE_ON)
|
||||
self.hass.pool.block_till_done()
|
||||
|
||||
@@ -66,7 +63,6 @@ class TestTemplateSwitch:
|
||||
state = self.hass.states.get('switch.test_template_switch')
|
||||
assert state.state == STATE_OFF
|
||||
|
||||
|
||||
def test_template_state_boolean_on(self):
|
||||
assert switch.setup(self.hass, {
|
||||
'switch': {
|
||||
@@ -278,7 +274,6 @@ class TestTemplateSwitch:
|
||||
|
||||
assert 1 == len(self.calls)
|
||||
|
||||
|
||||
def test_off_action(self):
|
||||
assert switch.setup(self.hass, {
|
||||
'switch': {
|
||||
|
||||
Reference in new issue
Block a user