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.helpers.test_entity
~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the entity helper.
"""
"""Test the entity helper."""
# pylint: disable=protected-access,too-many-public-methods
import unittest
@ -14,29 +9,29 @@ from tests.common import get_test_home_assistant
class TestHelpersEntity(unittest.TestCase):
""" Tests homeassistant.helpers.entity module. """
"""Test homeassistant.helpers.entity module."""
def setUp(self): # pylint: disable=invalid-name
""" Init needed objects. """
"""Init needed objects."""
self.entity = entity.Entity()
self.entity.entity_id = 'test.overwrite_hidden_true'
self.hass = self.entity.hass = get_test_home_assistant()
self.entity.update_ha_state()
def tearDown(self): # pylint: disable=invalid-name
""" Stop down stuff we started. """
"""Stop everything that was started."""
self.hass.stop()
entity.Entity.overwrite_attribute(self.entity.entity_id,
[ATTR_HIDDEN], [None])
def test_default_hidden_not_in_attributes(self):
""" Test that the default hidden property is set to False. """
"""Test that the default hidden property is set to False."""
self.assertNotIn(
ATTR_HIDDEN,
self.hass.states.get(self.entity.entity_id).attributes)
def test_overwriting_hidden_property_to_true(self):
""" Test we can overwrite hidden property to True. """
"""Test we can overwrite hidden property to True."""
entity.Entity.overwrite_attribute(self.entity.entity_id,
[ATTR_HIDDEN], [True])
self.entity.update_ha_state()
@ -45,6 +40,6 @@ class TestHelpersEntity(unittest.TestCase):
self.assertTrue(state.attributes.get(ATTR_HIDDEN))
def test_split_entity_id(self):
""" Test split_entity_id. """
"""Test split_entity_id."""
self.assertEqual(['domain', 'object_id'],
entity.split_entity_id('domain.object_id'))