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)
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)