~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2011-10-31 22:11:59 UTC
  • mfrom: (6236 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6252.
  • Revision ID: v.ladeuil+lp@free.fr-20111031221159-zmbd6izz1flzyisa
Merge trunk before submission

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        self.run_bzr(['mkdir', 'abc'], retcode=3)
42
42
        self.assertPathDoesNotExist('abc')
43
43
 
44
 
 
45
 
class TestVersioning(TestCaseInTempDir):
46
 
 
47
44
    def test_mkdir(self):
48
45
        """Basic 'bzr mkdir' operation"""
49
46
 
50
 
        self.run_bzr('init')
 
47
        self.make_branch_and_tree('.')
51
48
        self.run_bzr(['mkdir', 'foo'])
52
49
        self.assert_(os.path.isdir('foo'))
53
50
 
66
63
    def test_mkdir_in_subdir(self):
67
64
        """'bzr mkdir' operation in subdirectory"""
68
65
 
69
 
        self.run_bzr('init')
 
66
        self.make_branch_and_tree('.')
70
67
        self.run_bzr(['mkdir', 'dir'])
71
68
        self.assert_(os.path.isdir('dir'))
72
69
 
90
87
    def test_mkdir_w_nested_trees(self):
91
88
        """'bzr mkdir' with nested trees"""
92
89
 
93
 
        self.run_bzr('init')
94
 
        os.mkdir('a')
95
 
        os.chdir('a')
96
 
        self.run_bzr('init')
97
 
        os.mkdir('b')
98
 
        os.chdir('b')
99
 
        self.run_bzr('init')
100
 
        os.chdir('../..')
 
90
        self.make_branch_and_tree('.')
 
91
        self.make_branch_and_tree('a')
 
92
        self.make_branch_and_tree('a/b')
101
93
 
102
94
        self.run_bzr(['mkdir', 'dir', 'a/dir', 'a/b/dir'])
103
95
        self.assertTrue(os.path.isdir('dir'))
123
115
        self.assertEquals(delta.added[0][0], 'dir')
124
116
        self.assertFalse(delta.modified)
125
117
 
126
 
    def check_branch(self):
127
 
        """After all the above changes, run the check and upgrade commands.
128
 
 
129
 
        The upgrade should be a no-op."""
130
 
        b = Branch.open(u'.')
131
 
        mutter('branch has %d revisions', b.revno())
132
 
 
133
 
        mutter('check branch...')
134
 
        from bzrlib.check import check
135
 
        check(b, False)
 
118
    def test_mkdir_quiet(self):
 
119
        """'bzr mkdir --quiet' should not print a status message"""
 
120
 
 
121
        self.make_branch_and_tree('.')
 
122
        out, err = self.run_bzr(['mkdir', '--quiet', 'foo'])
 
123
        self.assertEquals('', err)
 
124
        self.assertEquals('', out)
136
125
 
137
126
 
138
127
class SubdirCommit(TestCaseWithTransport):