~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_import_tariff.py

  • Committer: Vincent Ladeuil
  • Date: 2011-05-28 10:51:18 UTC
  • mto: This revision was merged to the branch mainline in revision 5937.
  • Revision ID: v.ladeuil+lp@free.fr-20110528105118-h2w9jq34e2ql8eqv
Preserve $HOME/.bzr.log from tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import os
21
21
from testtools import content
22
22
 
 
23
from bzrlib import (
 
24
    osutils,
 
25
    trace,
 
26
    )
23
27
from bzrlib.bzrdir import BzrDir
24
28
from bzrlib.smart import medium
25
29
from bzrlib.transport import remote
61
65
                     'BZR_PLUGINS_AT', 'HOME'):
62
66
            self.preserved_env_vars[name] = os.environ.get(name)
63
67
        super(TestImportTariffs, self).setUp()
 
68
        self.log_path = osutils.pathjoin(self.test_home_dir, '.bzr.log')
 
69
        self.overrideEnv('BZR_LOG', self.log_path)
 
70
 
 
71
    def test_log_path_overriden(self):
 
72
        # ensure we get the log file in the right place
 
73
        actual_log_path = trace._get_bzr_log_filename()
 
74
        self.assertStartsWith(actual_log_path, self.test_home_dir)
 
75
        self.assertEquals(self.log_path, actual_log_path)
 
76
 
64
77
 
65
78
    def start_bzr_subprocess_with_import_check(self, args, stderr_file=None):
66
79
        """Run a bzr process and capture the imports.