~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

merge 2.0 branch rev 4647

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
class TestInit(ExternalBase):
35
35
 
 
36
    def setUp(self):
 
37
        ExternalBase.setUp(self)
 
38
        self._default_label = '2a'
 
39
 
36
40
    def test_init_with_format(self):
37
41
        # Verify bzr init --format constructs something plausible
38
42
        t = self.get_transport()
66
70
        repo = newdir.create_repository(shared=True)
67
71
        repo.set_make_working_trees(False)
68
72
        out, err = self.run_bzr('init repo')
69
 
        self.assertEqual("""Created a repository tree (format: pack-0.92)
 
73
        self.assertEqual("""Created a repository tree (format: %s)
70
74
Using shared repository: %s
71
 
""" % urlutils.local_path_from_url(
72
 
            repo.bzrdir.root_transport.external_url()), out)
 
75
""" % (self._default_label, urlutils.local_path_from_url(
 
76
            repo.bzrdir.root_transport.external_url())), out)
73
77
        self.assertEndsWith(out, "bzrlib.tests.blackbox.test_init.TestInit."
74
78
            "test_init_at_repository_root/work/repo/\n")
75
79
        self.assertEqual('', err)
78
82
 
79
83
    def test_init_branch(self):
80
84
        out, err = self.run_bzr('init')
81
 
        self.assertEqual("""Created a standalone tree (format: pack-0.92)\n""",
82
 
            out)
 
85
        self.assertEqual("Created a standalone tree (format: %s)\n" % (
 
86
            self._default_label,), out)
83
87
        self.assertEqual('', err)
84
88
 
85
89
        # Can it handle subdirectories of branches too ?
86
90
        out, err = self.run_bzr('init subdir1')
87
 
        self.assertEqual("""Created a standalone tree (format: pack-0.92)\n""",
88
 
            out)
 
91
        self.assertEqual("Created a standalone tree (format: %s)\n" % (
 
92
            self._default_label,), out)
89
93
        self.assertEqual('', err)
90
94
        WorkingTree.open('subdir1')
91
95
 
96
100
 
97
101
        os.mkdir('subdir2')
98
102
        out, err = self.run_bzr('init subdir2')
99
 
        self.assertEqual("""Created a standalone tree (format: pack-0.92)\n""",
100
 
            out)
 
103
        self.assertEqual("Created a standalone tree (format: %s)\n" % (
 
104
            self._default_label,), out)
101
105
        self.assertEqual('', err)
102
106
        # init an existing branch.
103
107
        out, err = self.run_bzr('init subdir2', retcode=3)
163
167
 
164
168
    def test_init(self):
165
169
        # init on a remote url should succeed.
166
 
        out, err = self.run_bzr(['init', self.get_url()])
 
170
        out, err = self.run_bzr(['init', '--pack-0.92', self.get_url()])
167
171
        self.assertEqual(out,
168
172
            """Created a standalone branch (format: pack-0.92)\n""")
169
173
        self.assertEqual('', err)