/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to tests/test_commit.py

  • Committer: John Arbash Meinel
  • Date: 2007-10-03 15:49:31 UTC
  • mto: (322.1.1 trunk) (330.3.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 368.
  • Revision ID: john@arbash-meinel.com-20071003154931-29y6lt71hx6bqhp7
We can make bencode work again by a simple decode/encode step.

Show diffs side-by-side

added added

removed removed

Lines of Context:
897
897
        dlg._do_commit()
898
898
 
899
899
        rev = tree.branch.repository.get_revision(dlg.committed_revision_id)
900
 
        file_info = rev.properties['file-info']
 
900
        file_info = rev.properties['file-info'].encode('UTF-8')
901
901
        value = ('ld7:file_id4:a-id'
902
902
                   '7:message16:Test \xc3\xban\xc3\xacc\xc3\xb6de\n'
903
903
                   '4:path1:a'
907
907
                   '4:path2:\xce\xa9'
908
908
                  'e'
909
909
                 'e')
910
 
        self.expectFailure('bencode and unicode does not mix properly with'
911
 
                           ' Revision XML serialization.',
912
 
                           self.assertEqual, value, file_info)
913
910
        self.assertEqual(value, file_info)
914
911
        file_info_decoded = bencode.bdecode(file_info)
915
912
        for d in file_info_decoded:
916
 
            d['path'] = d['path'].decode('utf8')
917
 
            d['message'] = d['message'].decode('utf8')
 
913
            d['path'] = d['path'].decode('UTF-8')
 
914
            d['message'] = d['message'].decode('UTF-8')
918
915
 
919
916
        self.assertEqual([{'path':u'a', 'file_id':'a-id',
920
917
                           'message':u'Test \xfan\xecc\xf6de\n'},