mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Advanced Ip filtering (#4424)
* Added IP Bans configuration * Fixing warnings * Added ban enabled option and unit tests * Fixed py34 tox * http: requested changes fix * Requested changes fix
This commit is contained in:
committed by
Paulus Schoutsen
parent
95b439fbd5
commit
2a7bc0e55c
@@ -1,6 +1,6 @@
|
||||
"""Test config validators."""
|
||||
from collections import OrderedDict
|
||||
from datetime import timedelta
|
||||
from datetime import timedelta, datetime, date
|
||||
import enum
|
||||
import os
|
||||
from socket import _GLOBAL_DEFAULT_TIMEOUT
|
||||
@@ -358,6 +358,17 @@ def test_time_zone():
|
||||
schema('UTC')
|
||||
|
||||
|
||||
def test_datetime():
|
||||
"""Test date time validation."""
|
||||
schema = vol.Schema(cv.datetime)
|
||||
for value in [date.today(), 'Wrong DateTime', '2016-11-23']:
|
||||
with pytest.raises(vol.MultipleInvalid):
|
||||
schema(value)
|
||||
|
||||
schema(datetime.now())
|
||||
schema('2016-11-23T18:59:08')
|
||||
|
||||
|
||||
def test_key_dependency():
|
||||
"""Test key_dependency validator."""
|
||||
schema = vol.Schema(cv.key_dependency('beer', 'soda'))
|
||||
|
||||
Reference in New Issue
Block a user