Пример #1
0
 def test_remove_random_numbers(self):
     keys = list(set([randint(0, 10000) for _ in range(500)]))
     shuffle(keys)
     tree = FastRBTree(zip(keys, keys))
     self.assertEqual(tree.count, len(keys))
     for key in keys:
         tree.remove(key)
     self.assertEqual(tree.count, 0)
Пример #2
0
 def test_remove_random_numbers(self):
     keys = list(set([randint(0, 10000) for _ in range(500)]))
     shuffle(keys)
     tree = FastRBTree(zip(keys, keys))
     self.assertEqual(tree.count, len(keys))
     for key in keys:
         tree.remove(key)
     self.assertEqual(tree.count, 0)
Пример #3
0
 def test_remove(self):
     tree = FastRBTree(self.values)
     for key in self.keys:
         tree.remove(key)
         self.assertRaises(KeyError, tree.get_value, key)
     self.assertEqual(tree.count, 0)
Пример #4
0
 def test_remove(self):
     tree = FastRBTree(self.values)
     for key in self.keys:
         tree.remove(key)
         self.assertRaises(KeyError, tree.get_value, key)
     self.assertEqual(tree.count, 0)