~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Alexander Belchenko
  • Date: 2008-01-28 22:48:19 UTC
  • mto: This revision was merged to the branch mainline in revision 3230.
  • Revision ID: bialix@ukr.net-20080128224819-88buaniv5dwy9vx4
$BZR_LOG is used to contol location of .bzr.log (use /dev/null or NUL to suppress log).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import os
20
20
 
21
21
from bzrlib.branch import Branch
22
 
from bzrlib.tests import TestCaseInTempDir
 
22
from bzrlib.tests.blackbox import ExternalBase
23
23
from bzrlib.trace import mutter
24
24
from bzrlib.config import (ensure_config_dir_exists, config_filename)
25
25
 
26
26
 
27
 
class TestAliases(TestCaseInTempDir):
 
27
class TestAliases(ExternalBase):
28
28
 
29
29
    def test_aliases(self):
30
30
 
39
39
            # Something is wrong in environment, 
40
40
            # we risk overwriting users config 
41
41
            self.assert_(config_filename() + "exists, abort")
42
 
        
 
42
 
43
43
        ensure_config_dir_exists()
44
44
        CONFIG=("[ALIASES]\n"
45
45
                "c=cat\n"
48
48
 
49
49
        open(config_filename(),'wb').write(CONFIG)
50
50
 
51
 
 
52
51
        str1 = 'foo\n'
53
52
        str2 = 'bar\n'
54
53
 
55
 
        bzr('init')
56
 
        open('a', 'wb').write(str1)
57
 
        bzr('add a')
58
 
 
59
 
        bzr('commit -m 1')
 
54
        tree = self.make_branch_and_tree('.')
 
55
        self.build_tree_contents([('a', str1)])
 
56
        tree.add('a')
 
57
        tree.commit(message='1')
60
58
 
61
59
        self.assertEquals(bzr('c a'), str1)
62
60
 
63
 
        open('a', 'wb').write(str2)
64
 
        bzr('commit -m 2')
 
61
        self.build_tree_contents([('a', str2)])
 
62
        tree.commit(message='2')
65
63
 
66
64
        self.assertEquals(bzr('c a'), str2)
67
65
        self.assertEquals(bzr('c1 a'), str1)