/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

  • Committer: John Arbash Meinel
  • Date: 2006-10-06 05:53:44 UTC
  • mfrom: (2063 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2071.
  • Revision ID: john@arbash-meinel.com-20061006055344-e73b97b7c6ca6e72
[merge] bzr.dev 2063

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
 
88
88
    def test_trace_unicode(self):
89
89
        """Write Unicode to trace log"""
90
 
        mutter(u'the unicode character for benzene is \N{BENZENE RING}')
91
 
        self._log_file.flush()
92
 
        self.assertContainsRe(self._get_log(), 'the unicode character',)
 
90
        self.log(u'the unicode character for benzene is \N{BENZENE RING}')
 
91
        self.assertContainsRe(self._get_log(keep_log_file=True),
 
92
                              "the unicode character for benzene is")
93
93
    
94
94
    def test_trace_argument_unicode(self):
95
95
        """Write a Unicode argument to the trace log"""
96
96
        mutter(u'the unicode character for benzene is %s', u'\N{BENZENE RING}')
97
 
        self._log_file.flush()
98
 
        self.assertContainsRe(self._get_log(), 'the unicode character')
 
97
        self.assertContainsRe(self._get_log(keep_log_file=True),
 
98
                              'the unicode character')
99
99
 
100
100
    def test_trace_argument_utf8(self):
101
101
        """Write a Unicode argument to the trace log"""
102
102
        mutter(u'the unicode character for benzene is %s',
103
103
               u'\N{BENZENE RING}'.encode('utf-8'))
104
 
        self._log_file.flush()
105
 
        self.assertContainsRe(self._get_log(), 'the unicode character')
 
104
        self.assertContainsRe(self._get_log(keep_log_file=True),
 
105
                              'the unicode character')
106
106
 
107
107
    def test_report_broken_pipe(self):
108
108
        try:
119
119
        mutter(u'Writing a greek mu (\xb5) works in a unicode string')
120
120
        mutter('But fails in an ascii string \xb5')
121
121
        mutter('and in an ascii argument: %s', '\xb5')
122
 
        # TODO: jam 20051227 mutter() doesn't flush the log file, and
123
 
        #       self._get_log() opens the file directly and reads it.
124
 
        #       So we need to manually flush the log file
125
 
        self._log_file.flush()
126
 
        log = self._get_log()
 
122
        log = self._get_log(keep_log_file=True)
127
123
        self.assertContainsRe(log, 'Writing a greek mu')
128
124
        self.assertContainsRe(log, "But fails in an ascii string")
129
125
        self.assertContainsRe(log, u"ascii argument: \xb5")