WIP Fix pylint and PEP257 issues (tests) (#4120)
* Fix pylint and PEP257 issues * More PEP257 fixes
This commit is contained in:
1 parent
443553ff16
commit
51e20c92f9
19 files changed
+89
-58
No files matched your search
@@ -14,11 +14,10 @@ from tests.common import get_test_home_assistant, assert_setup_component, \
|
||||
fire_time_changed
|
||||
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
class TestAutomation(unittest.TestCase):
|
||||
"""Test the event automation."""
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
@@ -27,12 +26,12 @@ class TestAutomation(unittest.TestCase):
|
||||
|
||||
@callback
|
||||
def record_call(service):
|
||||
"""Record call."""
|
||||
"""Helper to record calls."""
|
||||
self.calls.append(service)
|
||||
|
||||
self.hass.services.register('test', 'automation', record_call)
|
||||
|
||||
def tearDown(self): # pylint: disable=invalid-name
|
||||
def tearDown(self):
|
||||
"""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
@@ -438,20 +437,20 @@ class TestAutomation(unittest.TestCase):
|
||||
|
||||
@patch('homeassistant.config.load_yaml_config_file', autospec=True,
|
||||
return_value={
|
||||
automation.DOMAIN: {
|
||||
'alias': 'bye',
|
||||
'trigger': {
|
||||
'platform': 'event',
|
||||
'event_type': 'test_event2',
|
||||
},
|
||||
'action': {
|
||||
'service': 'test.automation',
|
||||
'data_template': {
|
||||
'event': '{{ trigger.event.event_type }}'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
automation.DOMAIN: {
|
||||
'alias': 'bye',
|
||||
'trigger': {
|
||||
'platform': 'event',
|
||||
'event_type': 'test_event2',
|
||||
},
|
||||
'action': {
|
||||
'service': 'test.automation',
|
||||
'data_template': {
|
||||
'event': '{{ trigger.event.event_type }}'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
def test_reload_config_service(self, mock_load_yaml):
|
||||
"""Test the reload config service."""
|
||||
assert setup_component(self.hass, automation.DOMAIN, {
|
||||
|
||||
Reference in new issue
Block a user