Disallow list/dict for string configuration (#17202)
This commit is contained in:
parent
c8266c6692
commit
6e81ae096e
2 changed files with 13 additions and 4 deletions
|
@ -356,9 +356,15 @@ def test_string():
|
|||
"""Test string validation."""
|
||||
schema = vol.Schema(cv.string)
|
||||
|
||||
with pytest.raises(vol.MultipleInvalid):
|
||||
with pytest.raises(vol.Invalid):
|
||||
schema(None)
|
||||
|
||||
with pytest.raises(vol.Invalid):
|
||||
schema([])
|
||||
|
||||
with pytest.raises(vol.Invalid):
|
||||
schema({})
|
||||
|
||||
for value in (True, 1, 'hello'):
|
||||
schema(value)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue