Exemple #1
0
 def test_levels (self):
     t0 = PersistentMap()
     random.seed (3141)
     for i in range (1000):
         k = random.randint (0, 100000)
         t0[k] = None
         t0.verify()
Exemple #2
0
 def test_levels(self):
     t0 = PersistentMap()
     random.seed(3141)
     for i in range(1000):
         k = random.randint(0, 100000)
         t0[k] = None
         t0.verify()
Exemple #3
0
 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)
Exemple #4
0
 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)