/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tests/test_blackbox.py

Fix two mistakes in 'bzr help git'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
import os
24
24
 
 
25
from bzrlib import (
 
26
    version_info as bzrlib_version,
 
27
    )
25
28
from bzrlib.bzrdir import (
26
29
    BzrDir,
27
30
    )
28
31
 
29
32
from bzrlib.tests.blackbox import ExternalBase
 
33
from bzrlib.tests import KnownFailure
30
34
 
31
35
from bzrlib.plugins.git import (
32
36
    tests,
69
73
        output, error = self.run_bzr(['branch', 'gitbranch', 'bzrbranch'])
70
74
        self.assertEqual(error, 'Branched 1 revision(s).\n')
71
75
 
 
76
    def test_checkout(self):
 
77
        os.mkdir("gitbranch")
 
78
        GitRepo.init(os.path.join(self.test_dir, "gitbranch"))
 
79
        os.chdir('gitbranch')
 
80
        builder = tests.GitBranchBuilder()
 
81
        builder.set_file('a', 'text for a\n', False)
 
82
        builder.commit('Joe Foo <joe@foo.com>', u'<The commit message>')
 
83
        builder.finish()
 
84
        os.chdir('..')
 
85
 
 
86
        output, error = self.run_bzr(['checkout', 'gitbranch', 'bzrbranch'])
 
87
        self.assertEqual(error, '')
 
88
        self.assertEqual(output, '')
 
89
 
72
90
    def test_branch_ls(self):
73
91
        self.simple_commit()
74
92
        output, error = self.run_bzr(['ls', '-r-1'])
76
94
        self.assertEqual(output, "a\n")
77
95
 
78
96
    def test_init(self):
79
 
        self.run_bzr("init-repo --git repo") 
 
97
        self.run_bzr("init --git repo")
80
98
 
81
99
    def test_info_verbose(self):
82
100
        self.simple_commit()
83
101
 
 
102
        if bzrlib_version < (2, 4):
 
103
            raise KnownFailure("bzr info uses inventory on bzr < 2.4")
 
104
 
84
105
        output, error = self.run_bzr(['info', '-v'])
85
106
        self.assertEqual(error, '')
86
107
        self.assertTrue("Standalone tree (format: git)" in output)
93
114
        GitRepo.init(os.path.join(self.test_dir, "bla"))
94
115
        self.run_bzr(['init', 'foo'])
95
116
        self.run_bzr(['commit', '--unchanged', '-m', 'bla', 'foo'])
 
117
        output, error = self.run_bzr(['push', '-d', 'foo', 'bla'], retcode=3)
 
118
        raise KnownFailure("roundtripping is not supported")
 
119
 
 
120
        # when roundtripping is supported
96
121
        output, error = self.run_bzr(['push', '-d', 'foo', 'bla'])
97
122
        self.assertEquals("", output)
98
123
        self.assertTrue(error.endswith("Created new branch.\n"))
128
153
 
129
154
        output, error = self.run_bzr(["tag", "bar"])
130
155
 
131
 
        self.assertEquals(error, '')
132
 
        self.assertEquals(output, 'Created tag bar.\n')
 
156
        # bzr <= 2.2 emits this message in the output stream
 
157
        # bzr => 2.3 emits this message in the error stream
 
158
        self.assertEquals(error + output, 'Created tag bar.\n')
133
159
 
134
160
    def test_init_repo(self):
135
 
        output, error = self.run_bzr(["init-repo", "--git", "bla.git"])
 
161
        output, error = self.run_bzr(["init", "--git", "bla.git"])
136
162
        self.assertEquals(error, '')
137
 
        self.assertEquals(output, 'Unshared repository with trees (format: git)\nLocation:\n  repository: bla.git\n')
 
163
        self.assertEquals(output, 'Created a standalone tree (format: git)\n')
138
164