def test_convert_to_unit(self):
        #convert_to_unit should change the unit of the calling instance to the requested new unit
        x=units.PhysicalQuantity('5cm')
        x.convert_to_unit('m')
        self.assertEqual(x,units.PhysicalQuantity('0.05m'))
        
        #Test for no compatible units
        x=units.PhysicalQuantity('5cm')
        try:
            x.convert_to_unit('kg')
        except __HOLE__,err:
            self.assertEqual(str(err),'Incompatible units')
        else: 
            self.fail("TypeError expected")

        x=units.PhysicalQuantity('1.0psi')
        x.convert_to_unit('psf')
        self.assertEqual(x,units.PhysicalQuantity('144.0psf'))
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.units/openmdao/units/test/test_units.py/test__PhysicalQuantity.test_convert_to_unit