Update for file header, docstrings, and PEP8/PEP257

This commit is contained in:
Fabian Affolter committed 2016-02-13 14:19:11 +01:00
1 parent 34b91cf6ce
commit 00afaac54c
74 files changed
+212 -211

No files matched your search

@@ -1,10 +1,9 @@
"""
tests.components.device_tracker.locative
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests.components.device_tracker.test_locative
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the locative device tracker component.
"""
import unittest
from unittest.mock import patch
@@ -24,7 +23,8 @@ hass = None
def _url(data={}):
""" Helper method to generate urls. """
data = "&".join(["{}={}".format(name, value) for name, value in data.items()])
data = "&".join(["{}={}".format(name, value) for
name, value in data.items()])
return "{}{}locative?{}".format(HTTP_BASE_URL, const.URL_API, data)
@@ -60,6 +60,7 @@ def tearDownModule(): # pylint: disable=invalid-name
""" Stops the Home Assistant server. """
hass.stop()
# Stub out update_config or else Travis CI raises an exception
@patch('homeassistant.components.device_tracker.update_config')
class TestLocative(unittest.TestCase):
@@ -114,7 +115,6 @@ class TestLocative(unittest.TestCase):
req = requests.get(_url(copy))
self.assertEqual(422, req.status_code)
def test_enter_and_exit(self, update_config):
""" Test when there is a known zone """
data = {
@@ -166,7 +166,6 @@ class TestLocative(unittest.TestCase):
state_name = hass.states.get('{}.{}'.format('device_tracker', data['device'])).state
self.assertEqual(state_name, 'work')
def test_exit_after_enter(self, update_config):
""" Test when an exit message comes after an enter message """