1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Fix PEP257 issues

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

View File

@@ -1,9 +1,4 @@
"""
tests.components.lock.test_demo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests demo lock component.
"""
"""The tests for the Demo lock platform."""
import unittest
from homeassistant.components import lock
@@ -16,9 +11,10 @@ KITCHEN = 'lock.kitchen_door'
class TestLockDemo(unittest.TestCase):
""" Test the demo lock. """
"""Test the demo lock."""
def setUp(self): # pylint: disable=invalid-name
"""Setup things to be run when tests are started."""
self.hass = get_test_home_assistant()
self.assertTrue(lock.setup(self.hass, {
'lock': {
@@ -27,10 +23,11 @@ class TestLockDemo(unittest.TestCase):
}))
def tearDown(self): # pylint: disable=invalid-name
""" Stop down stuff we started. """
"""Stop everything that was started."""
self.hass.stop()
def test_is_locked(self):
"""Test if lock is locked."""
self.assertTrue(lock.is_locked(self.hass, FRONT))
self.hass.states.is_state(FRONT, 'locked')
@@ -38,15 +35,15 @@ class TestLockDemo(unittest.TestCase):
self.hass.states.is_state(KITCHEN, 'unlocked')
def test_locking(self):
"""Test the locking of a lock."""
lock.lock(self.hass, KITCHEN)
self.hass.pool.block_till_done()
self.assertTrue(lock.is_locked(self.hass, KITCHEN))
def test_unlocking(self):
"""Test the unlocking of a lock."""
lock.unlock(self.hass, FRONT)
self.hass.pool.block_till_done()
self.assertFalse(lock.is_locked(self.hass, FRONT))