示例#1
0
 def test_key_comparator_with_single_path(self):
     k1 = Key()
     k2 = Key()
     p1 = k1.path.add()
     p2 = k2.path.add()
     p1.kind = p2.kind = 'dummy'
     self.assertEqual(helper.key_comparator(k1, k2), 0)
示例#2
0
 def test_key_comparator_with_multiple_paths_2(self):
     k1 = Key()
     k2 = Key()
     p11 = k1.path.add()
     p21 = k2.path.add()
     p22 = k2.path.add()
     p11.kind = p21.kind = p22.kind = 'dummy'
     self.assertLess(helper.key_comparator(k1, k2), 0)
示例#3
0
 def test_key_comparator_with_multiple_paths_4(self):
     k1 = Key()
     k2 = Key()
     p11 = k1.path.add()
     p12 = k2.path.add()
     p21 = k2.path.add()
     p11.kind = p12.kind = 'dummy'
     # make path2 greater than path1
     p21.kind = 'dummy1'
     self.assertLess(helper.key_comparator(k1, k2), 0)