Beispiel #1
0
 def test_AvoidCollision(self):
     d = {"1": 1}
     d[util.FindUniqueId(d)] = 1
     self.assertEqual(2, len(d))
     self.assertFalse("3" in d, "Ops, next statement should add something to d")
     d["3"] = None
     d[util.FindUniqueId(d)] = 1
     self.assertEqual(4, len(d))
Beispiel #2
0
 def test_simple(self):
     d = {}
     for i in range(0, 5):
         d[util.FindUniqueId(d)] = 1
     k = d.keys()
     k.sort()
     self.assertEqual(('0', '1', '2', '3', '4'), tuple(k))
Beispiel #3
0
 def test_simple(self):
     d = {}
     for i in range(0, 5):
         d[util.FindUniqueId(d)] = 1
     k = d.keys()
     k.sort()
     self.assertEqual(("0", "1", "2", "3", "4"), tuple(k))