~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-30 18:28:17 UTC
  • mfrom: (5967.10.2 test-cat)
  • Revision ID: pqm@pqm.ubuntu.com-20110630182817-83a5q9r9rxfkdn8r
(mbp) don't use subprocesses for testing cat (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
class TestInit(TestCaseWithTransport):
37
37
 
38
38
    def setUp(self):
39
 
        super(TestInit, self).setUp()
 
39
        TestCaseWithTransport.setUp(self)
40
40
        self._default_label = '2a'
41
41
 
42
42
    def test_init_with_format(self):
48
48
        self.assertIsDirectory('.bzr/checkout/lock', t)
49
49
 
50
50
    def test_init_format_2a(self):
51
 
        """Smoke test for constructing a format 2a repository."""
 
51
        """Smoke test for constructing a format 2a repoistory."""
52
52
        out, err = self.run_bzr('init --format=2a')
53
53
        self.assertEqual("""Created a standalone tree (format: 2a)\n""",
54
54
            out)
55
55
        self.assertEqual('', err)
56
56
 
57
 
    def test_init_colocated(self):
58
 
        """Smoke test for constructing a colocated branch."""
59
 
        out, err = self.run_bzr('init --format=development-colo file:,branch=abranch')
60
 
        self.assertEqual("""Created a lightweight checkout (format: development-colo)\n""",
61
 
            out)
62
 
        self.assertEqual('', err)
63
 
        out, err = self.run_bzr('branches')
64
 
        self.assertEqual("  abranch\n", out)
65
 
        self.assertEqual('', err)
66
 
 
67
57
    def test_init_at_repository_root(self):
68
58
        # bzr init at the root of a repository should create a branch
69
59
        # and working tree even when creation of working trees is disabled.
168
158
 
169
159
    def test_init_default_format_option(self):
170
160
        """bzr init should read default format from option default_format"""
171
 
        g_store = _mod_config.GlobalStore()
172
 
        g_store._load_from_string('''
 
161
        conf = _mod_config.GlobalConfig.from_string('''
173
162
[DEFAULT]
174
163
default_format = 1.9
175
 
''')
176
 
        g_store.save()
 
164
''', save=True)
177
165
        out, err = self.run_bzr_subprocess('init')
178
166
        self.assertContainsRe(out, '1.9')
179
167
 
215
203
    def test_init_append_revisions_only(self):
216
204
        self.run_bzr('init --dirstate-tags normal_branch6')
217
205
        branch = _mod_branch.Branch.open('normal_branch6')
218
 
        self.assertEqual(None, branch.get_append_revisions_only())
 
206
        self.assertEqual(None, branch._get_append_revisions_only())
219
207
        self.run_bzr('init --append-revisions-only --dirstate-tags branch6')
220
208
        branch = _mod_branch.Branch.open('branch6')
221
 
        self.assertEqual(True, branch.get_append_revisions_only())
 
209
        self.assertEqual(True, branch._get_append_revisions_only())
222
210
        self.run_bzr_error(['cannot be set to append-revisions-only'],
223
211
                           'init --append-revisions-only --knit knit')
224
212