def test_levels (self): t0 = PersistentMap() random.seed (3141) for i in range (1000): k = random.randint (0, 100000) t0[k] = None t0.verify()
def test_levels(self): t0 = PersistentMap() random.seed(3141) for i in range(1000): k = random.randint(0, 100000) t0[k] = None t0.verify()
def test_to_empty (self): t0 = PersistentMap() random.seed (3141) l = [] for i in range (1000): k = random.randint (0, 1000000) t0[k] = None l.append (k) t0.verify() random.shuffle (l) size = len(t0) self.assertEqual (size, 1000) for k in l: del t0[k] size -= 1 self.assertEqual (len(t0), size)
def test_to_empty(self): t0 = PersistentMap() random.seed(3141) l = [] for i in range(1000): k = random.randint(0, 1000000) t0[k] = None l.append(k) t0.verify() random.shuffle(l) size = len(t0) self.assertEqual(size, 1000) for k in l: del t0[k] size -= 1 self.assertEqual(len(t0), size)