~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testtrace.py

Fix trace of non-ascii messages, and add test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import sys
24
24
 
25
25
from bzrlib.selftest import TestCaseInTempDir, TestCase
26
 
from bzrlib.trace import format_exception_short
 
26
from bzrlib.trace import format_exception_short, mutter
27
27
from bzrlib.errors import NotBranchError
28
28
 
29
29
class TestTrace(TestCase):
49
49
            pass
50
50
        msg = format_exception_short(sys.exc_info())
51
51
        self.assertEqualDiff(msg, 'Not a branch: wibble')
 
52
 
 
53
    def test_trace_unicode(self):
 
54
        """Write Unicode to trace log"""
 
55
        self.log(u'the unicode character for benzene is \N{BENZENE RING}')
 
56
        self.assertContainsRe('the unicode character',
 
57
                self._get_log())