~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

[merge] up-to-date against bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import os
23
23
import sys
24
24
 
25
 
from bzrlib.selftest import TestCaseInTempDir, TestCase
26
 
from bzrlib.trace import format_exception_short
 
25
from bzrlib.tests import TestCaseInTempDir, TestCase
 
26
from bzrlib.trace import format_exception_short, mutter
27
27
from bzrlib.errors import NotBranchError
28
28
 
29
29
class TestTrace(TestCase):
37
37
        self.assertEqualDiff(error_lines[0], 
38
38
                'exceptions.NotImplementedError: time travel')
39
39
        self.assertContainsRe(error_lines[1], 
40
 
                r'^  at .*testtrace\.py line \d+$')  
 
40
                r'^  at .*trace\.py line \d+$')  
41
41
        self.assertContainsRe(error_lines[2], 
42
42
                r'^  in test_format_sys_exception$')
43
43
 
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())