def test_cmp(self):
        x=units.PhysicalQuantity('1 d')
        y = units.PhysicalQuantity('2 d')
        self.assertEqual(cmp(x,y),-1)
        self.assertEqual(cmp(y,x),1)
        self.assertEqual(cmp(x,x),0)

        try:
            cmp(x,2)
        except __HOLE__,err:
            self.assertEqual("Incompatible types",str(err))
        else:
            self.fail('Expecting TypeError')
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.units/openmdao/units/test/test_units.py/test__PhysicalQuantity.test_cmp