test/unittest_utils.py
branch3.5
changeset 3146 cfc4344023f2
parent 2635 c94df21f7ab2
child 3293 69c0ba095536
equal deleted inserted replaced
3145:9b28545de60d 3146:cfc4344023f2
    15     def test_1(self):
    15     def test_1(self):
    16         self.assertNotEquals(make_uid('xyz'), make_uid('abcd'))
    16         self.assertNotEquals(make_uid('xyz'), make_uid('abcd'))
    17         self.assertNotEquals(make_uid('xyz'), make_uid('xyz'))
    17         self.assertNotEquals(make_uid('xyz'), make_uid('xyz'))
    18 
    18 
    19     def test_2(self):
    19     def test_2(self):
    20         d = {}
    20         d = set()
    21         while len(d)<10000:
    21         while len(d)<10000:
    22             uid = make_uid('xyz')
    22             uid = make_uid('xyz')
    23             if d.has_key(uid):
    23             if uid in d:
    24                 self.fail(len(d))
    24                 self.fail(len(d))
    25             d[uid] = 1
    25             d.add(uid)
    26 
    26 
    27 
    27 
    28 class UStringIOTC(TestCase):
    28 class UStringIOTC(TestCase):
    29     def test_boolean_value(self):
    29     def test_boolean_value(self):
    30         self.assert_(UStringIO())
    30         self.assert_(UStringIO())