~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
30
30
from bzrlib.trace import (
31
31
    mutter, mutter_callsite, report_exception,
32
32
    set_verbosity_level, get_verbosity_level, is_quiet, is_verbose, be_quiet,
 
33
    _rollover_trace_maybe,
33
34
    )
34
35
 
35
36
 
174
175
        self.assertEqual(-1, get_verbosity_level())
175
176
        be_quiet(False)
176
177
        self.assertEqual(0, get_verbosity_level())
 
178
 
 
179
 
 
180
class TestBzrLog(TestCaseInTempDir):
 
181
 
 
182
    def test_log_rollover(self):
 
183
        temp_log_name = 'test-log'
 
184
        trace_file = open(temp_log_name, 'at')
 
185
        trace_file.write('test_log_rollover padding\n' * 1000000)
 
186
        trace_file.close()
 
187
        _rollover_trace_maybe(temp_log_name)
 
188
        # should have been rolled over
 
189
        self.assertFalse(os.access(temp_log_name, os.R_OK))