Pytest tests (#17750)

* Convert core tests

* Convert component tests to use pytest assert

* Lint 🤷‍♂️

* Fix test

* Fix 3 typos in docs
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2018-10-24 12:10:05 +02:00
1 parent 4222f7562b
commit 08fe7c3ece
223 files changed
+6747 -7237

No files matched your search

+2 -4
View File
@@ -44,8 +44,7 @@ class TestFolderSensor(unittest.TestCase):
'platform': 'folder',
CONF_FOLDER_PATHS: 'invalid_path'}
}
self.assertTrue(
setup_component(self.hass, 'sensor', config))
assert setup_component(self.hass, 'sensor', config)
assert len(self.hass.states.entity_ids()) == 0
def test_valid_path(self):
@@ -56,8 +55,7 @@ class TestFolderSensor(unittest.TestCase):
'platform': 'folder',
CONF_FOLDER_PATHS: TEST_DIR}
}
self.assertTrue(
setup_component(self.hass, 'sensor', config))
assert setup_component(self.hass, 'sensor', config)
assert len(self.hass.states.entity_ids()) == 1
state = self.hass.states.get('sensor.test_folder')
assert state.state == '0.0'