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
26
class TestAdded(ExternalBase):
27
class TestAdded(TestCaseInTempDir):
28
29
def test_added(self):
29
30
"""Test that 'added' command reports added files"""
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, '')
36
40
# in empty directory, nothing added
37
tree = self.make_branch_and_tree('.')
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')])
44
48
# after add, shows up in list
45
49
# bug report 20060119 by Nathan McCallum -- 'bzr added' causes
50
54
# after commit, now no longer listed
51
tree.commit(message='add a')
55
bzr('commit', '-m', 'add a')