tests/test-pathencode.py
branchstable
changeset 19318 9778c77f05d6
parent 18435 8c019d2fd7c0
child 19319 ec17ddecdf64
equal deleted inserted replaced
19317:66da6e9feacd 19318:9778c77f05d6
   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     while l < k:
   129         p = pickfrom(rng, resttable)(rng)
   129         p = pickfrom(rng, resttable)(rng)
   130         l += len(p)
   130         l += len(p)
   131         ps.append(p)
   131         ps.append(p)
   132     ps.append(pickfrom(rng, lasttable)(rng))
   132     ps.append(pickfrom(rng, lasttable)(rng))
   133     return ''.join(ps)
   133     return ''.join(ps)