def testFloat( self ):
      # Default initialize
      style = MySubStyle()
      self.assertEqual( None, MySubStyle.prop.default,
               msg = "Class default value for 'prop' wrong" )
      self.assertEqual( None, style.prop,
               msg = "Instance default value for 'style.prop' wrong" )

      # Change the local copy
      style.prop = 5.0
      self.assertEqual( None, MySubStyle.prop.default,
               msg = "1) Class default value for 'prop' changed" )
      self.assertEqual( 5.0, style.prop,
               msg = "1) Instance value for 'style.prop' wrong" )

      # Make a new instance
      newStyle = MySubStyle( prop = 3.0 )
      self.assertEqual( None, MySubStyle.prop.default,
               msg = "2) Class default value for 'prop' changed" )
      self.assertEqual( 5.0, style.prop,
               msg = "2) Instance value for 'style.prop' wrong" )
      self.assertEqual( 3.0, newStyle.prop,
               msg = "2) Instance value for 'newStyle.prop' wrong" )

      # Check converter
      newStyle.prop = 9
      self.assertEqual( None, MySubStyle.prop.default,
               msg = "3) Class default value for 'prop' changed" )
      self.assertEqual( 5.0, style.prop,
               msg = "3) Instance value for 'style.prop' wrong" )
      self.assertEqual( 9.0, newStyle.prop,
               msg = "3) Instance value for 'newStyle.prop' wrong" )

      # Error condition
      msg = "Failed to raise on invalid value."
      self.assertRaises( Exception, MySubStyle, prop='bad', msg = msg )

      msg = "Failed to raise on low value."
      self.assertRaises( Exception, MySubStyle, prop=-1.0, msg = msg )

      msg = "Failed to raise on high value."
      self.assertRaises( Exception, MySubStyle, prop=100.0, msg = msg )

      # String check
      s = 'Float: MySubStyle.prop'
      self.assertEqual( s, str(MySubStyle.prop), msg = "Incorrect string value" )

#=======================================================================
Test Float style property.
dataset/ETHPy150Open nasa/mplStyle/mplStyle/types/property/test/test_Float.py/TestFloat.testFloat