def test_add_unit(self):
        try:
            units.add_unit('ft','20*m')
        except __HOLE__,err: 
            self.assertEqual(str(err),"'Unit ft already defined with different factor or powers'")
        else:
            self.fail("Expecting Key Error")
            
        try:
            units.add_offset_unit('degR','degK',20,10)
        except KeyError,err: 
            self.assertEqual(str(err),"'Unit degR already defined with different factor or powers'")
        else:
            self.fail("Expecting Key Error")
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.units/openmdao/units/test/test_units.py/test__moduleFunctions.test_add_unit