Beispiel #1
0
 def test_default_config(self):
     config = trace.DefaultConfig()
     self.overrideAttr(trace, "_bzr_log_filename", None)
     trace._bzr_log_filename = None
     expected_filename = trace._get_bzr_log_filename()
     self.assertEqual(None, trace._bzr_log_filename)
     config.__enter__()
     try:
         # Should have entered and setup a default filename.
         self.assertEqual(expected_filename, trace._bzr_log_filename)
     finally:
         config.__exit__(None, None, None)
         # Should have exited and cleaned up.
         self.assertEqual(None, trace._bzr_log_filename)
Beispiel #2
0
def _attach_log_tail(pr):
    try:
        bzr_log = open(trace._get_bzr_log_filename(), 'rt')
    except (IOError, OSError), e:
        pr['BzrLogTail'] = repr(e)
        return