~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_log.py

  • Committer: James Westby
  • Date: 2009-03-12 07:12:20 UTC
  • mfrom: (4110.1.1 log-p)
  • mto: This revision was merged to the branch mainline in revision 4128.
  • Revision ID: james.westby@canonical.com-20090312071220-4jy068t5l1kvk776
Fixed problem with `log -p` and non-ascii content of files

Show diffs side-by-side

added added

removed removed

Lines of Context:
659
659
 
660
660
""")
661
661
 
 
662
    def test_log_show_diff_non_ascii(self):
 
663
        # Smoke test for bug #328007 UnicodeDecodeError on 'log -p'
 
664
        message = u'Message with \xb5'
 
665
        body = 'Body with \xb5\n'
 
666
        wt = self.make_branch_and_tree('.')
 
667
        self.build_tree_contents([('foo', body)])
 
668
        wt.add('foo')
 
669
        wt.commit(message=message)
 
670
        # check that command won't fail with unicode error
 
671
        # don't care about exact output because we have other tests for this
 
672
        out,err = self.run_bzr('log -p --long')
 
673
        self.assertNotEqual('', out)
 
674
        self.assertEqual('', err)
 
675
        out,err = self.run_bzr('log -p --short')
 
676
        self.assertNotEqual('', out)
 
677
        self.assertEqual('', err)
 
678
        out,err = self.run_bzr('log -p --line')
 
679
        self.assertNotEqual('', out)
 
680
        self.assertEqual('', err)
 
681
 
662
682
 
663
683
class TestLogEncodings(TestCaseInTempDir):
664
684
 
671
691
        'latin-1',
672
692
        'iso-8859-1',
673
693
        'cp437', # Common windows encoding
674
 
        'cp1251', # Alexander Belchenko's windows encoding
 
694
        'cp1251', # Russian windows encoding
675
695
        'cp1258', # Common windows encoding
676
696
    ]
677
697
    # Encodings which cannot encode mu