~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2007-06-26 08:02:36 UTC
  • mto: This revision was merged to the branch mainline in revision 2555.
  • Revision ID: mbp@sourcefrog.net-20070626080236-14ihgomtffc9tezj
Cleanup old variations on run_bzr in the test suite

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
26
26
        
27
27
    def test_add_reports(self):
28
28
        """add command prints the names of added files."""
29
 
        self.runbzr('init')
 
29
        self.run_bzr('init')
30
30
        self.build_tree(['top.txt', 'dir/', 'dir/sub.txt', 'CVS'])
31
31
        self.build_tree_contents([('.bzrignore', 'CVS\n')])
32
32
        out = self.run_bzr_captured(['add'], retcode=0)[0]
49
49
 
50
50
    def test_add_quiet_is(self):
51
51
        """add -q does not print the names of added files."""
52
 
        self.runbzr('init')
 
52
        self.run_bzr('init')
53
53
        self.build_tree(['top.txt', 'dir/', 'dir/sub.txt'])
54
54
        out = self.run_bzr_captured(['add', '-q'], retcode=0)[0]
55
55
        # the ordering is not defined at the moment
61
61
 
62
62
        "bzr add" should add the parent(s) as necessary.
63
63
        """
64
 
        self.runbzr('init')
 
64
        self.run_bzr('init')
65
65
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
66
 
        self.assertEquals(self.capture('unknowns'), 'inertiatic\n')
 
66
        self.assertEquals(self.run_bzr_captured(['unknowns'])[0], 'inertiatic\n')
67
67
        self.run_bzr('add', 'inertiatic/esp')
68
 
        self.assertEquals(self.capture('unknowns'), '')
 
68
        self.assertEquals(self.run_bzr_captured(['unknowns'])[0], '')
69
69
 
70
70
        # Multiple unversioned parents
71
71
        self.build_tree(['veil/', 'veil/cerpin/', 'veil/cerpin/taxt'])
72
 
        self.assertEquals(self.capture('unknowns'), 'veil\n')
 
72
        self.assertEquals(self.run_bzr_captured(['unknowns'])[0], 'veil\n')
73
73
        self.run_bzr('add', 'veil/cerpin/taxt')
74
 
        self.assertEquals(self.capture('unknowns'), '')
 
74
        self.assertEquals(self.run_bzr_captured(['unknowns'])[0], '')
75
75
 
76
76
        # Check whacky paths work
77
77
        self.build_tree(['cicatriz/', 'cicatriz/esp'])
78
 
        self.assertEquals(self.capture('unknowns'), 'cicatriz\n')
 
78
        self.assertEquals(self.run_bzr_captured(['unknowns'])[0], 'cicatriz\n')
79
79
        self.run_bzr('add', 'inertiatic/../cicatriz/esp')
80
 
        self.assertEquals(self.capture('unknowns'), '')
 
80
        self.assertEquals(self.run_bzr_captured(['unknowns'])[0], '')
81
81
 
82
82
    def test_add_in_versioned(self):
83
83
        """Try to add a file in a versioned directory.
84
84
 
85
85
        "bzr add" should do this happily.
86
86
        """
87
 
        self.runbzr('init')
 
87
        self.run_bzr('init')
88
88
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
89
 
        self.assertEquals(self.capture('unknowns'), 'inertiatic\n')
 
89
        self.assertEquals(self.run_bzr_captured(['unknowns'])[0], 'inertiatic\n')
90
90
        self.run_bzr('add', '--no-recurse', 'inertiatic')
91
 
        self.assertEquals(self.capture('unknowns'), 'inertiatic/esp\n')
 
91
        self.assertEquals(self.run_bzr_captured(['unknowns'])[0], 'inertiatic/esp\n')
92
92
        self.run_bzr('add', 'inertiatic/esp')
93
 
        self.assertEquals(self.capture('unknowns'), '')
 
93
        self.assertEquals(self.run_bzr_captured(['unknowns'])[0], '')
94
94
 
95
95
    def test_subdir_add(self):
96
96
        """Add in subdirectory should add only things from there down"""
115
115
        # subdirectory
116
116
        chdir('src')
117
117
        self.run_bzr('add')
118
 
        self.assertEquals(self.capture('unknowns'), 'README\n')
 
118
        self.assertEquals(self.run_bzr_captured(['unknowns'])[0], 'README\n')
119
119
        # reopen to see the new changes
120
120
        t = t.bzrdir.open_workingtree()
121
121
        versioned = [path for path, entry in t.iter_entries_by_dir()]
125
125
        # add from the parent directory should pick up all file names
126
126
        chdir('..')
127
127
        self.run_bzr('add')
128
 
        self.assertEquals(self.capture('unknowns'), '')
 
128
        self.assertEquals(self.run_bzr_captured(['unknowns'])[0], '')
129
129
        self.run_bzr('check')
130
130
 
131
131
    def test_add_missing(self):