~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Aaron Bentley
  • Date: 2007-08-20 13:07:12 UTC
  • mfrom: (2732 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2733.
  • Revision ID: abentley@panoramicfeedback.com-20070820130712-buopmg528zcgwyxc
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 import TestCaseInTempDir
25
 
from bzrlib.tests.treeshape import build_tree_contents
 
24
from bzrlib.tests.blackbox import ExternalBase
26
25
 
27
 
class TestAdded(TestCaseInTempDir):
 
26
class TestAdded(ExternalBase):
28
27
 
29
28
    def test_added(self):
30
29
        """Test that 'added' command reports added files"""
34
33
            self.assertEquals(out, expected)
35
34
            self.assertEquals(err, '')
36
35
 
37
 
        def bzr(*args):
38
 
            self.run_bzr(*args)
39
 
 
40
36
        # in empty directory, nothing added
41
 
        bzr('init')
 
37
        tree = self.make_branch_and_tree('.')
42
38
        check_added('')
43
39
 
44
40
        # with unknown file, still nothing added
45
 
        build_tree_contents([('a', 'contents of a\n')])
 
41
        self.build_tree_contents([('a', 'contents of a\n')])
46
42
        check_added('')
47
43
 
48
44
        # after add, shows up in list
49
45
        # bug report 20060119 by Nathan McCallum -- 'bzr added' causes
50
46
        # NameError
51
 
        bzr('add a')
 
47
        tree.add('a')
52
48
        check_added('a\n')
53
49
 
54
50
        # after commit, now no longer listed
55
 
        bzr(['commit', '-m', 'add a'])
 
51
        tree.commit(message='add a')
56
52
        check_added('')