~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_aliases.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-08-24 21:59:21 UTC
  • mfrom: (5363.2.22 controldir-1)
  • Revision ID: pqm@pqm.ubuntu.com-20100824215921-p4nheij9k4x6i1jw
(jelmer) Split generic interface code out of bzrlib.bzrdir.BzrDir into
 bzrlib.controldir.ControlDir. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
21
 
from bzrlib import config
22
21
from bzrlib.branch import Branch
23
22
from bzrlib.tests import TestCaseWithTransport
24
23
from bzrlib.trace import mutter
 
24
from bzrlib.config import (ensure_config_dir_exists, config_filename)
25
25
 
26
26
 
27
27
class TestAliases(TestCaseWithTransport):
35
35
            return self.run_bzr(args, **kwargs)[1]
36
36
 
37
37
 
38
 
        conf = config.GlobalConfig.from_string('''[ALIASES]
39
 
c=cat
40
 
c1=cat -r 1
41
 
c2=cat -r 1 -r2
42
 
''', save=True)
 
38
        if os.path.isfile(config_filename()):
 
39
            # Something is wrong in environment,
 
40
            # we risk overwriting users config
 
41
            self.assert_(config_filename() + "exists, abort")
 
42
 
 
43
        ensure_config_dir_exists()
 
44
        CONFIG=("[ALIASES]\n"
 
45
                "c=cat\n"
 
46
                "c1=cat -r 1\n"
 
47
                "c2=cat -r 1 -r2\n")
 
48
 
 
49
        open(config_filename(),'wb').write(CONFIG)
43
50
 
44
51
        str1 = 'foo\n'
45
52
        str2 = 'bar\n'