~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2008-09-26 22:14:42 UTC
  • mto: This revision was merged to the branch mainline in revision 3747.
  • Revision ID: john@arbash-meinel.com-20080926221442-3r67j99sr9rwe9w0
Make message optional, don't check the memory flag directly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import os
21
21
 
22
22
from bzrlib.tests.blackbox import ExternalBase
 
23
from bzrlib.tests.test_win32utils import NeedsGlobExpansionFeature
23
24
 
24
25
 
25
26
class TestAdd(ExternalBase):
26
27
        
27
28
    def test_add_reports(self):
28
29
        """add command prints the names of added files."""
29
 
        self.run_bzr('init')
 
30
        tree = self.make_branch_and_tree('.')
30
31
        self.build_tree(['top.txt', 'dir/', 'dir/sub.txt', 'CVS'])
31
32
        self.build_tree_contents([('.bzrignore', 'CVS\n')])
32
33
        out = self.run_bzr('add')[0]
49
50
 
50
51
    def test_add_quiet_is(self):
51
52
        """add -q does not print the names of added files."""
52
 
        self.run_bzr('init')
 
53
        tree = self.make_branch_and_tree('.') 
53
54
        self.build_tree(['top.txt', 'dir/', 'dir/sub.txt'])
54
55
        out = self.run_bzr('add -q')[0]
55
56
        # the ordering is not defined at the moment
61
62
 
62
63
        "bzr add" should add the parent(s) as necessary.
63
64
        """
64
 
        self.run_bzr('init')
 
65
        tree = self.make_branch_and_tree('.')
65
66
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
66
67
        self.assertEquals(self.run_bzr('unknowns')[0], 'inertiatic\n')
67
68
        self.run_bzr('add inertiatic/esp')
84
85
 
85
86
        "bzr add" should do this happily.
86
87
        """
87
 
        self.run_bzr('init')
 
88
        tree = self.make_branch_and_tree('.')
88
89
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
89
90
        self.assertEquals(self.run_bzr('unknowns')[0], 'inertiatic\n')
90
91
        self.run_bzr('add --no-recurse inertiatic')
192
193
        self.build_tree(['.bzr/crescent'])
193
194
        err = self.run_bzr('add .bzr/crescent', retcode=3)[1]
194
195
        self.assertContainsRe(err, r'ERROR:.*\.bzr.*control file')
 
196
 
 
197
    def test_add_with_wildcards(self):
 
198
        self.requireFeature(NeedsGlobExpansionFeature)
 
199
        self.make_branch_and_tree('.')
 
200
        self.build_tree(['a1', 'a2', 'b', 'c33'])
 
201
        self.run_bzr(['add', 'a?', 'c*'])
 
202
        self.assertEquals(self.run_bzr('unknowns')[0], 'b\n')
 
203
 
 
204
    def test_add_with_wildcards_unicode(self):
 
205
        self.requireFeature(NeedsGlobExpansionFeature)
 
206
        self.make_branch_and_tree('.')
 
207
        self.build_tree([u'\u1234A', u'\u1235A', u'\u1235AA', 'cc'])
 
208
        self.run_bzr(['add', u'\u1234?', u'\u1235*'])
 
209
        self.assertEquals(self.run_bzr('unknowns')[0], 'cc\n')