#NEWLINE# def testFloat( self ) : #NEWLINE# #INDENT# 'Test Float style property.' #NEWLINE# style = MySubStyle ( ) #NEWLINE# self . assertEqual ( None , MySubStyle . prop . default , msg = "Class default value for 'prop' wrong" ) #NEWLINE# self . assertEqual ( None , style . prop , msg = "Instance default value for 'style.prop' wrong" ) #NEWLINE# style . prop = 5.0 #NEWLINE# self . assertEqual ( None , MySubStyle . prop . default , msg = "1) Class default value for 'prop' changed" ) #NEWLINE# self . assertEqual ( 5.0 , style . prop , msg = "1) Instance value for 'style.prop' wrong" ) #NEWLINE# newStyle = MySubStyle ( prop = 3.0 ) #NEWLINE# self . assertEqual ( None , MySubStyle . prop . default , msg = "2) Class default value for 'prop' changed" ) #NEWLINE# self . assertEqual ( 5.0 , style . prop , msg = "2) Instance value for 'style.prop' wrong" ) #NEWLINE# self . assertEqual ( 3.0 , newStyle . prop , msg = "2) Instance value for 'newStyle.prop' wrong" ) #NEWLINE# newStyle . prop = 9 #NEWLINE# self . assertEqual ( None , MySubStyle . prop . default , msg = "3) Class default value for 'prop' changed" ) #NEWLINE# self . assertEqual ( 5.0 , msg . prop , msg = "3) Instance value for 'style.prop' wrong" ) #NEWLINE# self . assertEqual ( 9.0 , newStyle . prop , msg = "3) Instance value for 'newStyle.prop' wrong" ) #NEWLINE# msg = 'Failed to raise on invalid value.' #NEWLINE# self . assertRaises ( Exception , MySubStyle , prop = 'bad' , msg = msg ) #NEWLINE# msg = 'Failed to raise on low value.' #NEWLINE# self . assertRaises ( Exception , MySubStyle , prop = ( - 1.0 ) , msg = msg ) #NEWLINE# msg = 'Failed to raise on high value.' #NEWLINE# self . assertRaises ( Exception , MySubStyle , prop = 100.0 , msg = msg ) #NEWLINE# s = 'Float: MySubStyle.prop' #NEWLINE# self . assertEqual ( s , str ( MySubStyle . prop ) , msg = 'Incorrect string value' )