#NEWLINE# def testToOneOf( self ) : #NEWLINE# #INDENT# 'Test the ToOneOf converter.' #NEWLINE# cvtList = [ cvt . Converter ( cvt . toType , float ) , cvt . Converter ( cvt . toType , str ) ] #NEWLINE# converter = cvt . toOneOf #NEWLINE# s1 = 'test' #NEWLINE# f1 = '1234' #NEWLINE# rs = s1 #NEWLINE# rf = float ( f1 ) #NEWLINE# t = converter ( s1 , cvtList ) #NEWLINE# self . assertEqual ( rs , t , 'Incorrect conversion of a string.' ) #NEWLINE# t = converter ( f1 , cvtList ) #NEWLINE# self . assertEqual ( rf , t , 'Incorrect conversion of an Epoch.' ) #NEWLINE# self . assertRaises ( Exception , rf , [ 1 , 2 ] , cvtList , name = 'value' , msg = 'List argument should be an error.' )