예제 #1
0
 def testMatrix(self):
     a = (257276184,
          [
              [0, 0, -1, 0],
              [0, 1, 0, 0],
              [2, 0, 0, 0],
              [10, 0, 0, 1]])
     b = (257276184,
          [
              [2.2204460492503131e-16, 0.0, -1.0, 0.0],
              [0.0, 1.0, 0.0, 0.0],
              [2.0, 0.0, 4.4408920985006262e-16, 0.0],
              [10.0, 0.0, 0.0, 1.0]])
     self.assertTrue(compare(a, b))
예제 #2
0
 def testDictVsSet(self):
     a = {'a': 1, 'b': 2, 'c': 1.00000}
     b = set([1, 2, 3, 4])
     self.assertFalse(compare(a, b))
예제 #3
0
 def testDictVsList(self):
     a = {'a': 1, 'b': 2, 'c': 1.00000}
     b = [1, 2, 1.0000]
     self.assertFalse(compare(a, b))
예제 #4
0
 def testIntVsFloat(self):
     self.assertTrue(compare(1.00, 1))
예제 #5
0
 def assertCompare(self, val, eq, neq):
     self.assertTrue(compare(val, eq))
     self.assertFalse(compare(val, neq))
예제 #6
0
 def testObjVsDict(self):
     a = sphere()
     b = {'foo': 'bar'}
     self.assertFalse(compare(a, b))
     self.assertFalse(compare(b, a))