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:
parent
4222f7562b
commit
08fe7c3ece
223 changed files with 6747 additions and 7237 deletions
|
@ -12,14 +12,14 @@ class TestBinarySensor(unittest.TestCase):
|
|||
def test_state(self):
|
||||
"""Test binary sensor state."""
|
||||
sensor = binary_sensor.BinarySensorDevice()
|
||||
self.assertEqual(STATE_OFF, sensor.state)
|
||||
assert STATE_OFF == sensor.state
|
||||
with mock.patch('homeassistant.components.binary_sensor.'
|
||||
'BinarySensorDevice.is_on',
|
||||
new=False):
|
||||
self.assertEqual(STATE_OFF,
|
||||
binary_sensor.BinarySensorDevice().state)
|
||||
assert STATE_OFF == \
|
||||
binary_sensor.BinarySensorDevice().state
|
||||
with mock.patch('homeassistant.components.binary_sensor.'
|
||||
'BinarySensorDevice.is_on',
|
||||
new=True):
|
||||
self.assertEqual(STATE_ON,
|
||||
binary_sensor.BinarySensorDevice().state)
|
||||
assert STATE_ON == \
|
||||
binary_sensor.BinarySensorDevice().state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue