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:
@@ -1,9 +1,4 @@
|
||||
"""
|
||||
tests.components.test_sun
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Tests Sun component.
|
||||
"""
|
||||
"""The tests for the Sun component."""
|
||||
# pylint: disable=too-many-public-methods,protected-access
|
||||
import unittest
|
||||
from datetime import timedelta
|
||||
@@ -18,24 +13,25 @@ from tests.common import get_test_home_assistant
|
||||
|
||||
|
||||
class TestSun(unittest.TestCase):
|
||||
""" Test the sun module. """
|
||||
"""Test the sun module."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def tearDown(self): # pylint: disable=invalid-name
|
||||
""" Stop down stuff we started. """
|
||||
"""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
def test_is_on(self):
|
||||
""" Test is_on method. """
|
||||
"""Test is_on method."""
|
||||
self.hass.states.set(sun.ENTITY_ID, sun.STATE_ABOVE_HORIZON)
|
||||
self.assertTrue(sun.is_on(self.hass))
|
||||
self.hass.states.set(sun.ENTITY_ID, sun.STATE_BELOW_HORIZON)
|
||||
self.assertFalse(sun.is_on(self.hass))
|
||||
|
||||
def test_setting_rising(self):
|
||||
""" Test retrieving sun setting and rising. """
|
||||
"""Test retrieving sun setting and rising."""
|
||||
latitude = 32.87336
|
||||
longitude = 117.22743
|
||||
|
||||
@@ -76,7 +72,7 @@ class TestSun(unittest.TestCase):
|
||||
self.assertIsNone(sun.next_setting(self.hass, 'non.existing'))
|
||||
|
||||
def test_state_change(self):
|
||||
""" Test if the state changes at next setting/rising. """
|
||||
"""Test if the state changes at next setting/rising."""
|
||||
self.hass.config.latitude = '32.87336'
|
||||
self.hass.config.longitude = '117.22743'
|
||||
sun.setup(self.hass, {sun.DOMAIN: {sun.CONF_ELEVATION: 0}})
|
||||
|
||||
Reference in New Issue
Block a user