~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

  • Committer: Carl Friedrich Bolz
  • Date: 2006-08-17 11:10:57 UTC
  • mto: This revision was merged to the branch mainline in revision 2026.
  • Revision ID: cfbolz@gmx.de-20060817111057-108585811d3d24bb
Throw away on-disk logfile when possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
    def test_trace_unicode(self):
81
81
        """Write Unicode to trace log"""
82
82
        self.log(u'the unicode character for benzene is \N{BENZENE RING}')
83
 
        self.assertContainsRe('the unicode character',
84
 
                self._get_log())
 
83
        self.assertContainsRe(self._get_log(keep_log_file=True),
 
84
                              "the unicode character for benzene is")
85
85
 
86
86
    def test_report_broken_pipe(self):
87
87
        try:
97
97
        # raise an exception
98
98
        mutter(u'Writing a greek mu (\xb5) works in a unicode string')
99
99
        mutter('But fails in an ascii string \xb5')
100
 
        # TODO: jam 20051227 mutter() doesn't flush the log file, and
101
 
        #       self._get_log() opens the file directly and reads it.
102
 
        #       So we need to manually flush the log file
103
 
        import bzrlib.trace
104
 
        bzrlib.trace._trace_file.flush()
105
 
        log = self._get_log()
 
100
        log = self._get_log(keep_log_file=True)
106
101
        self.assertContainsRe(log, 'Writing a greek mu')
107
102
        self.assertContainsRe(log, 'UnicodeError')
108
103
        self.assertContainsRe(log, "'But fails in an ascii string")