tests/test-pathencode.py
branchstable
changeset 19319 ec17ddecdf64
parent 19318 9778c77f05d6
child 19327 cf1b0a58a0de
equal deleted inserted replaced
19318:9778c77f05d6 19319:ec17ddecdf64
   123     '''Construct a part of a pathname, without slashes.'''
   123     '''Construct a part of a pathname, without slashes.'''
   124 
   124 
   125     p = pickfrom(rng, firsttable)(rng)
   125     p = pickfrom(rng, firsttable)(rng)
   126     l = len(p)
   126     l = len(p)
   127     ps = [p]
   127     ps = [p]
   128     while l < k:
   128     maxl = rng.randint(1, k)
       
   129     while l < maxl:
   129         p = pickfrom(rng, resttable)(rng)
   130         p = pickfrom(rng, resttable)(rng)
   130         l += len(p)
   131         l += len(p)
   131         ps.append(p)
   132         ps.append(p)
   132     ps.append(pickfrom(rng, lasttable)(rng))
   133     ps.append(pickfrom(rng, lasttable)(rng))
   133     return ''.join(ps)
   134     return ''.join(ps)