~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to testchangeset.py

  • Committer: John Arbash Meinel
  • Date: 2005-07-16 16:22:04 UTC
  • mto: (1185.82.1 bzr-w-changeset) (0.5.98)
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: john@arbash-meinel.com-20050716162204-ca86975b99b2742e
Handling international characters, added more test cases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
276
276
        self.assertEqual(cset_txt.readline(), '# \n')
277
277
 
278
278
        rev = self.b1.get_revision(rev_id)
279
 
        self.assertEqual(cset_txt.readline(), '# committer: %s\n' % rev.committer)
 
279
        self.assertEqual(cset_txt.readline().decode('utf-8'),
 
280
                u'# committer: %s\n' % rev.committer)
280
281
 
281
282
        open(',,cset', 'wb').write(cset_txt.getvalue())
282
283
        cset_txt.seek(0)
414
415
                , 'b1/dir/'
415
416
                , 'b1/dir/filein subdir.c'
416
417
                , 'b1/dir/WithCaps.txt'
 
418
                , 'b1/dir/trailing space '
417
419
                , 'b1/sub/'
418
420
                , 'b1/sub/sub/'
419
421
                , 'b1/sub/sub/nonempty.txt'
426
428
                , 'dir'
427
429
                , 'dir/filein subdir.c'
428
430
                , 'dir/WithCaps.txt'
 
431
                , 'dir/trailing space '
429
432
                , 'sub'
430
433
                , 'sub/sub'
431
434
                , 'sub/sub/nonempty.txt'
464
467
        cset = self.get_valid_cset('a@cset-0-2', 'a@cset-0-4', auto_commit=True)
465
468
        cset = self.get_valid_cset('a@cset-0-3', 'a@cset-0-4', auto_commit=True)
466
469
 
 
470
        # Modified files
 
471
        open('b1/sub/dir/WithCaps.txt', 'ab').write('\nAdding some text\n')
 
472
        #open('b1/sub/dir/trailing space ', 'ab').write('\nAdding some\nDOS format lines\n')
 
473
        #self.b1.rename_one('sub/dir/trailing space ', 'sub/start and end space')
 
474
        self.b1.commit('Modified files', rev_id='a@cset-0-5')
 
475
        cset = self.get_valid_cset('a@cset-0-4', 'a@cset-0-5')
 
476
        cset = self.get_valid_cset('a@cset-0-4', 'a@cset-0-5', auto_commit=True)
 
477
        cset = self.get_valid_cset(None, 'a@cset-0-5', auto_commit=True)
 
478
 
 
479
        # Handle international characters
 
480
        f = open(u'b1/with Dod\xe9', 'wb')
 
481
        f.write((u'A file\n'
 
482
            u'With international man of mystery\n'
 
483
            u'William Dod\xe9\n').encode('utf-8'))
 
484
        self.b1.add([u'with Dod\xe9'])
 
485
        # BUG: (sort of) You must set verbose=False, so that python doesn't try
 
486
        #       and print the name of William Dode as part of the commit
 
487
        self.b1.commit(u'i18n commit from William Dod\xe9', rev_id='a@cset-0-6',
 
488
                committer=u'William Dod\xe9', verbose=False)
 
489
        cset = self.get_valid_cset('a@cset-0-5', 'a@cset-0-6')
 
490
        cset = self.get_valid_cset('a@cset-0-5', 'a@cset-0-6', auto_commit=True)
 
491
        cset = self.get_valid_cset(None, 'a@cset-0-6', auto_commit=True)
 
492
 
 
493
 
 
494
 
467
495
TEST_CLASSES = [
468
496
    CTreeTester,
469
497
    CSetTester