~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Alexander Belchenko
  • Date: 2007-01-04 23:36:44 UTC
  • mfrom: (2224 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2225.
  • Revision ID: bialix@ukr.net-20070104233644-7znkxoj9b0y7ev28
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import os
22
22
 
23
23
from bzrlib.branch import Branch
24
 
from bzrlib.tests.blackbox import ExternalBase
 
24
from bzrlib.tests import TestCaseInTempDir
 
25
from bzrlib.tests.treeshape import build_tree_contents
25
26
 
26
 
class TestAdded(ExternalBase):
 
27
class TestAdded(TestCaseInTempDir):
27
28
 
28
29
    def test_added(self):
29
30
        """Test that 'added' command reports added files"""
30
31
 
31
32
        def check_added(expected):
32
 
            out, err = self.run_bzr('added')
 
33
            out, err = self.run_bzr_captured(['added'])
33
34
            self.assertEquals(out, expected)
34
35
            self.assertEquals(err, '')
35
36
 
 
37
        def bzr(*args):
 
38
            self.run_bzr(*args)
 
39
 
36
40
        # in empty directory, nothing added
37
 
        tree = self.make_branch_and_tree('.')
 
41
        bzr('init')
38
42
        check_added('')
39
43
 
40
44
        # with unknown file, still nothing added
41
 
        self.build_tree_contents([('a', 'contents of a\n')])
 
45
        build_tree_contents([('a', 'contents of a\n')])
42
46
        check_added('')
43
47
 
44
48
        # after add, shows up in list
45
49
        # bug report 20060119 by Nathan McCallum -- 'bzr added' causes
46
50
        # NameError
47
 
        tree.add('a')
 
51
        bzr('add', 'a')
48
52
        check_added('a\n')
49
53
 
50
54
        # after commit, now no longer listed
51
 
        tree.commit(message='add a')
 
55
        bzr('commit', '-m', 'add a')
52
56
        check_added('')