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
|
@ -5,6 +5,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.core import State
|
||||
from homeassistant.helpers import (intent, config_validation as cv)
|
||||
import pytest
|
||||
|
||||
|
||||
class MockIntentHandler(intent.IntentHandler):
|
||||
|
@ -33,12 +34,12 @@ class TestIntentHandler(unittest.TestCase):
|
|||
vol.Required('name'): cv.string,
|
||||
})
|
||||
|
||||
self.assertRaises(vol.error.MultipleInvalid,
|
||||
handler1.async_validate_slots, {})
|
||||
self.assertRaises(vol.error.MultipleInvalid,
|
||||
handler1.async_validate_slots, {'name': 1})
|
||||
self.assertRaises(vol.error.MultipleInvalid,
|
||||
handler1.async_validate_slots, {'name': 'kitchen'})
|
||||
with pytest.raises(vol.error.MultipleInvalid):
|
||||
handler1.async_validate_slots({})
|
||||
with pytest.raises(vol.error.MultipleInvalid):
|
||||
handler1.async_validate_slots({'name': 1})
|
||||
with pytest.raises(vol.error.MultipleInvalid):
|
||||
handler1.async_validate_slots({'name': 'kitchen'})
|
||||
handler1.async_validate_slots({'name': {'value': 'kitchen'}})
|
||||
handler1.async_validate_slots({
|
||||
'name': {'value': 'kitchen'},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue