~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-03 20:18:35 UTC
  • mfrom: (1185.82.137 w-changeset)
  • Revision ID: pqm@pqm.ubuntu.com-20060603201835-1c9a1725641ccd24
Implement bundles

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
import os
21
21
 
22
 
from bzrlib import ignores
23
 
 
24
22
from bzrlib.tests.blackbox import ExternalBase
25
23
 
26
24
 
28
26
        
29
27
    def test_add_reports(self):
30
28
        """add command prints the names of added files."""
31
 
        ignores._set_user_ignores(['./.bazaar'])
32
 
 
33
29
        self.runbzr('init')
34
30
        self.build_tree(['top.txt', 'dir/', 'dir/sub.txt', 'CVS'])
35
 
        self.build_tree_contents([('.bzrignore', 'CVS\n')])
36
31
        out = self.run_bzr_captured(['add'], retcode=0)[0]
37
32
        # the ordering is not defined at the moment
38
33
        results = sorted(out.rstrip('\n').split('\n'))
39
34
        self.assertEquals(['If you wish to add some of these files, please'\
40
35
                           ' add them by name.',
41
 
                           'added .bzrignore',
42
36
                           'added dir',
43
37
                           'added dir/sub.txt',
44
38
                           'added top.txt',
45
 
                           'ignored 2 file(s).'],
 
39
                           'ignored 1 file(s).'],
46
40
                          results)
47
41
        out = self.run_bzr_captured(['add', '-v'], retcode=0)[0]
48
42
        results = sorted(out.rstrip('\n').split('\n'))
49
43
        self.assertEquals(['If you wish to add some of these files, please'\
50
44
                           ' add them by name.',
51
 
                           'ignored .bazaar matching "./.bazaar"',
52
45
                           'ignored CVS matching "CVS"'],
53
46
                          results)
54
47
 
66
59
 
67
60
        "bzr add" should add the parent(s) as necessary.
68
61
        """
69
 
        ignores._set_user_ignores(['./.bazaar'])
70
 
 
71
62
        self.runbzr('init')
72
63
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
73
64
        self.assertEquals(self.capture('unknowns'), 'inertiatic\n')
91
82
 
92
83
        "bzr add" should do this happily.
93
84
        """
94
 
        ignores._set_user_ignores(['./.bazaar'])
95
 
 
96
85
        self.runbzr('init')
97
86
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
98
87
        self.assertEquals(self.capture('unknowns'), 'inertiatic\n')
104
93
    def test_subdir_add(self):
105
94
        """Add in subdirectory should add only things from there down"""
106
95
        from bzrlib.workingtree import WorkingTree
107
 
 
108
 
        ignores._set_user_ignores(['./.bazaar'])
 
96
        
109
97
        eq = self.assertEqual
110
 
        ass = self.assertTrue
 
98
        ass = self.assert_
111
99
        chdir = os.chdir
112
100
        
113
101
        t = self.make_branch_and_tree('.')
131
119
        self.run_bzr('add')
132
120
        self.assertEquals(self.capture('unknowns'), '')
133
121
        self.run_bzr('check')
134
 
 
135
 
    def test_add_missing(self):
136
 
        """bzr add foo where foo is missing should error."""
137
 
        self.make_branch_and_tree('.')
138
 
        self.run_bzr('add', 'missing-file', retcode=3)