1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

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
2018-10-24 12:10:05 +02:00
committed by GitHub
parent 4222f7562b
commit 08fe7c3ece
223 changed files with 6747 additions and 7237 deletions

View File

@@ -42,8 +42,7 @@ class TestSigfoxSensor(unittest.TestCase):
with requests_mock.Mocker() as mock_req:
url = re.compile(API_URL + 'devicetypes')
mock_req.get(url, text='{}', status_code=401)
self.assertTrue(
setup_component(self.hass, 'sensor', VALID_CONFIG))
assert setup_component(self.hass, 'sensor', VALID_CONFIG)
assert len(self.hass.states.entity_ids()) == 0
def test_valid_credentials(self):
@@ -59,8 +58,7 @@ class TestSigfoxSensor(unittest.TestCase):
url3 = re.compile(API_URL + 'devices/fake_id/messages*')
mock_req.get(url3, text=VALID_MESSAGE)
self.assertTrue(
setup_component(self.hass, 'sensor', VALID_CONFIG))
assert setup_component(self.hass, 'sensor', VALID_CONFIG)
assert len(self.hass.states.entity_ids()) == 1
state = self.hass.states.get('sensor.sigfox_fake_id')