/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-20 17:58:18 UTC
  • mto: This revision was merged to the branch mainline in revision 1875.
  • Revision ID: john@arbash-meinel.com-20060720175818-b973d54278a39ef7
Update the tests to verify the length of the file id, as suggested by mbp

Show diffs side-by-side

added added

removed removed

Lines of Context:
262
262
        # hidden file id
263
263
        self.assertStartsWith(gen_file_id(u'\xe5\xb5.txt'), 'txt-')
264
264
        
265
 
        # We truncate long filenames to be friendly to OS. This is
266
 
        # less important with case squashing, because we do less escaping
267
 
        # (A long all-caps filename used to create a *huge* filename on disk)
 
265
        # Our current method of generating unique ids adds 33 characters
 
266
        # plus an serial number (log10(N) characters)
 
267
        # to the end of the filename. We now restrict the filename portion to
 
268
        # be <= 20 characters, so the maximum length should now be approx < 60
 
269
 
 
270
        # Test both case squashing and length restriction
268
271
        fid = gen_file_id('A'*50 + '.txt')
269
272
        self.assertStartsWith(fid, 'a'*20 + '-')
 
273
        self.failUnless(len(fid) < 60)
270
274
 
271
275
        # restricting length happens after the other actions, so
272
 
        # we preserv as much as possible
 
276
        # we preserve as much as possible
273
277
        fid = gen_file_id('\xe5\xb5..aBcd\tefGhijKLMnop\tqrstuvwxyz')
274
278
        self.assertStartsWith(fid, 'abcdefghijklmnopqrst-')
 
279
        self.failUnless(len(fid) < 60)
275
280
 
276
281
    def test_next_id_suffix(self):
277
282
        bzrlib.workingtree._gen_id_suffix = None