def test_init(self):
        #__init__ should have the same result regardless of the 
        #constructor calling pattern
           
 
        x=units.PhysicalQuantity('1m')
        y=units.PhysicalQuantity(1,'m')
        self.assertEqual(x.value,y.value)
        self.assertEqual(x.unit,y.unit)
        
        z=units.PhysicalQuantity('1dam') #check for two letter prefixes
        
        #error for improper init argument
        try:
            x=units.PhysicalQuantity('m')
        except TypeError,err:
            self.assertEqual(str(err),"No number found in input argument: 'm'")
        else:
            self.fail("Expecting TypeError")
            
        try:
            x=units.PhysicalQuantity('1in')
        except ValueError,err:
            self.assertEqual(str(err),"no unit named 'in' is defined")
        else:
            self.fail("Expecting ValueError")
            
        try:
            x=units.PhysicalQuantity(1,None)
        except __HOLE__,err:
            self.assertEqual(str(err),"None is not a unit")
        else:
            self.fail("Expecting TypeError")
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.units/openmdao/units/test/test_units.py/test__PhysicalQuantity.test_init