~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

  • Committer: Martin Pool
  • Date: 2008-02-07 03:49:57 UTC
  • mto: This revision was merged to the branch mainline in revision 3219.
  • Revision ID: mbp@sourcefrog.net-20080207034957-cc7tlku5xfya9wei
Update test_push_log_file to handle there always being timestamps at the start of the trace messages

Show diffs side-by-side

added added

removed removed

Lines of Context:
182
182
                pop_log_file(memento1)
183
183
            # the files were opened in binary mode, so should have exactly
184
184
            # these bytes.  and removing the file as the log target should
185
 
            # have caused them to be flushed out.
186
 
            self.assertFileEqual("comment to file1\nagain to file1\n", tmp1.name)
187
 
            self.assertFileEqual("comment to file2\n", tmp2.name)
 
185
            # have caused them to be flushed out.  need to match using regexps
 
186
            # as there's a timestamp at the front.
 
187
            tmp1.seek(0)
 
188
            self.assertContainsRe(tmp1.read(),
 
189
                r"\d+\.\d+  comment to file1\n\d+\.\d+  again to file1\n")
 
190
            tmp2.seek(0)
 
191
            self.assertContainsRe(tmp2.read(),
 
192
                r"\d+\.\d+  comment to file2\n")
188
193
        finally:
189
194
            tmp1.close()
190
195
            tmp2.close()