/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

More work on roundtrip push support.

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
 
    )
28
25
from bzrlib.bzrdir import (
29
26
    BzrDir,
30
27
    )
31
28
 
32
29
from bzrlib.tests.blackbox import ExternalBase
33
 
from bzrlib.tests import KnownFailure
34
30
 
35
31
from bzrlib.plugins.git import (
36
32
    tests,
73
69
        output, error = self.run_bzr(['branch', 'gitbranch', 'bzrbranch'])
74
70
        self.assertEqual(error, 'Branched 1 revision(s).\n')
75
71
 
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
 
 
90
72
    def test_branch_ls(self):
91
73
        self.simple_commit()
92
74
        output, error = self.run_bzr(['ls', '-r-1'])
94
76
        self.assertEqual(output, "a\n")
95
77
 
96
78
    def test_init(self):
97
 
        self.run_bzr("init --git repo")
 
79
        self.run_bzr("init-repo --git repo") 
98
80
 
99
81
    def test_info_verbose(self):
100
82
        self.simple_commit()
101
83
 
102
 
        if bzrlib_version < (2, 4):
103
 
            raise KnownFailure("bzr info uses inventory on bzr < 2.4")
104
 
 
105
84
        output, error = self.run_bzr(['info', '-v'])
106
85
        self.assertEqual(error, '')
107
86
        self.assertTrue("Standalone tree (format: git)" in output)
114
93
        GitRepo.init(os.path.join(self.test_dir, "bla"))
115
94
        self.run_bzr(['init', 'foo'])
116
95
        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
121
96
        output, error = self.run_bzr(['push', '-d', 'foo', 'bla'])
122
97
        self.assertEquals("", output)
123
98
        self.assertTrue(error.endswith("Created new branch.\n"))
153
128
 
154
129
        output, error = self.run_bzr(["tag", "bar"])
155
130
 
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')
 
131
        self.assertEquals(error, '')
 
132
        self.assertEquals(output, 'Created tag bar.\n')
159
133
 
160
134
    def test_init_repo(self):
161
 
        output, error = self.run_bzr(["init", "--git", "bla.git"])
 
135
        output, error = self.run_bzr(["init-repo", "--git", "bla.git"])
162
136
        self.assertEquals(error, '')
163
 
        self.assertEquals(output, 'Created a standalone tree (format: git)\n')
 
137
        self.assertEquals(output, 'Unshared repository with trees (format: git)\nLocation:\n  repository: bla.git\n')
164
138