Beispiel #1
0
 def test_getSinglePosValueKey(self):
     device = builder.buildDevice([(10, 1), (11, 3)])
     a1 = builder.buildValue({"XPlacement": 500, "XPlaDevice": device})
     a2 = builder.buildValue({"XPlacement": 500, "XPlaDevice": device})
     b = builder.buildValue({"XPlacement": 500})
     keyA1 = builder._getSinglePosValueKey(a1)
     keyA2 = builder._getSinglePosValueKey(a1)
     keyB = builder._getSinglePosValueKey(b)
     self.assertEqual(keyA1, keyA2)
     self.assertEqual(hash(keyA1), hash(keyA2))
     self.assertNotEqual(keyA1, keyB)
     self.assertNotEqual(hash(keyA1), hash(keyB))
Beispiel #2
0
 def test_getSinglePosValueKey(self):
     device = builder.buildDevice({10: 1, 11: 3})
     a1 = builder.buildValue({"XPlacement": 500, "XPlaDevice": device})
     a2 = builder.buildValue({"XPlacement": 500, "XPlaDevice": device})
     b = builder.buildValue({"XPlacement": 500})
     keyA1 = builder._getSinglePosValueKey(a1)
     keyA2 = builder._getSinglePosValueKey(a1)
     keyB = builder._getSinglePosValueKey(b)
     assert keyA1 == keyA2
     assert hash(keyA1) == hash(keyA2)
     assert keyA1 != keyB
     assert hash(keyA1) != hash(keyB)
 def test_getSinglePosValueKey(self):
     device = builder.buildDevice({10:1, 11:3})
     a1 = builder.buildValue({"XPlacement": 500, "XPlaDevice": device})
     a2 = builder.buildValue({"XPlacement": 500, "XPlaDevice": device})
     b = builder.buildValue({"XPlacement": 500})
     keyA1 = builder._getSinglePosValueKey(a1)
     keyA2 = builder._getSinglePosValueKey(a1)
     keyB = builder._getSinglePosValueKey(b)
     self.assertEqual(keyA1, keyA2)
     self.assertEqual(hash(keyA1), hash(keyA2))
     self.assertNotEqual(keyA1, keyB)
     self.assertNotEqual(hash(keyA1), hash(keyB))