def test_add_known_Values(self):
        #addition should give known result with known input. 
        #he resulting unit should be the same as the unit of the calling instance
        #The units of the results should be the same as the units of the calling instance
        
        #test addition function for allowed addition values
        known_add_values=(('1m','5m',6),('1cm','1cm',2),('1cm','1ft',31.48))
        for q1,q2,result in known_add_values:
            x=units.PhysicalQuantity(q1)
            y=units.PhysicalQuantity(q2)
            sum = x+y
            self.assertEqual(sum.value,result)
            self.assertEqual(sum.unit,x.unit)

        #test for error if incompatible units
        q1 = units.PhysicalQuantity('1cm')
        q2 = units.PhysicalQuantity('1kg')
        
        try: 
            q1 + q2
        except TypeError,err:
            self.assertEqual(str(err),"Incompatible units")
        else: 
            self.fail("expecting TypeError")
            
        #test offset units
        q1 = units.PhysicalQuantity('1degK')
        q2 = units.PhysicalQuantity('1degR')
        q3 = units.PhysicalQuantity('1degC')
        
        result = q1 + q2
        self.assertAlmostEqual(result.value,1.556,3)
        self.assertEqual(result.unit, q1.unit)
        
        try:
            q3 + q2
        except __HOLE__, err: 
            self.assertEqual(str(err),"Unit conversion (degR to degC) cannot be expressed as a simple multiplicative factor")
        else: 
            self.fail('expecting TypeError')
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.units/openmdao/units/test/test_units.py/test__PhysicalQuantity.test_add_known_Values