#NEWLINE# def test_time_period( ) : #NEWLINE# #INDENT# 'Test time_period validation.' #NEWLINE# schema = vol . Schema ( cv . time_period ) #NEWLINE# for value in ( None , '' , 1234 , 'hello:world' , '12:' , '12:34:56:78' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'wrong_key' : ( - 10 ) , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# with pytest . raises ( vol . MultipleInvalid ) : #NEWLINE# #INDENT# schema ( value ) #NEWLINE# #UNINDENT# #UNINDENT# for value in ( '8:20' , '23:59' , '-8:20' , '-23:59:59' , '-48:00' , { #NEWLINE# #INDENT# 'minutes' : 5 , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# schema ( value ) #NEWLINE# #UNINDENT# assert ( timedelta ( hours = 23 , minutes = 59 ) == schema ( '23:59' ) ) #NEWLINE# assert ( ( ( - 1 ) * timedelta ( hours = 1 , minutes = 15 ) ) == schema ( '-1:15' ) )