~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        self.log(u'the unicode character for benzene is \N{BENZENE RING}')
67
67
        self.assertContainsRe('the unicode character',
68
68
                self._get_log())
 
69
 
 
70
    def test_mutter_never_fails(self):
 
71
        # Even if the decode/encode stage fails, mutter should not
 
72
        # raise an exception
 
73
        mutter(u'Writing a greek mu (\xb5) works in a unicode string')
 
74
        mutter('But fails in an ascii string \xb5')
 
75
        # TODO: jam 20051227 mutter() doesn't flush the log file, and
 
76
        #       self._get_log() opens the file directly and reads it.
 
77
        #       So we need to manually flush the log file
 
78
        import bzrlib.trace
 
79
        bzrlib.trace._trace_file.flush()
 
80
        log = self._get_log()
 
81
        self.assertContainsRe(log, 'Writing a greek mu')
 
82
        self.assertContainsRe(log, 'UnicodeError')
 
83
        self.assertContainsRe(log, "'But fails in an ascii string")
 
84