~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_bzrdir/test_bzrdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-11-30 20:33:06 UTC
  • mfrom: (4807.3.4 2.1.0b4-test-kipple)
  • Revision ID: pqm@pqm.ubuntu.com-20091130203306-wut4brq0gaith8to
(jam) Reduce some test 'kipple'

Show diffs side-by-side

added added

removed removed

Lines of Context:
1235
1235
            return
1236
1236
        self.assertNotEqual(repo.bzrdir.root_transport.base,
1237
1237
            made_repo.bzrdir.root_transport.base)
1238
 
        # New repositories are write locked.
1239
 
        self.assertTrue(made_repo.is_write_locked())
1240
 
        made_repo.unlock()
1241
1238
 
1242
1239
    def test_format_initialize_on_transport_ex_force_new_repo_False(self):
1243
1240
        t = self.get_transport('repo')
1270
1267
            # uninitialisable format
1271
1268
            return
1272
1269
        self.assertLength(1, repo._fallback_repositories)
1273
 
        # New repositories are write locked.
1274
 
        self.assertTrue(repo.is_write_locked())
1275
 
        repo.unlock()
1276
1270
 
1277
1271
    def test_format_initialize_on_transport_ex_default_stack_on(self):
1278
1272
        # When initialize_on_transport_ex uses a stacked-on branch because of
1295
1289
        repo_name = repo_fmt.repository_format.network_name()
1296
1290
        repo, control = self.assertInitializeEx(
1297
1291
            t, need_meta=True, repo_format_name=repo_name, stacked_on=None)
 
1292
        # self.addCleanup(repo.unlock)
1298
1293
        if control is None:
1299
1294
            # uninitialisable format
1300
1295
            return
1326
1321
            # must stay with the all-in-one-format.
1327
1322
            repo_name = self.bzrdir_format.network_name()
1328
1323
        self.assertEqual(repo_name, repo._format.network_name())
1329
 
        # New repositories are write locked.
1330
 
        self.assertTrue(repo.is_write_locked())
1331
 
        repo.unlock()
1332
1324
 
1333
1325
    def assertInitializeEx(self, t, need_meta=False, **kwargs):
1334
1326
        """Execute initialize_on_transport_ex and check it succeeded correctly.
1346
1338
            return None, None
1347
1339
        repo, control, require_stacking, repo_policy = \
1348
1340
            self.bzrdir_format.initialize_on_transport_ex(t, **kwargs)
 
1341
        if repo is not None:
 
1342
            # Repositories are open write-locked
 
1343
            self.assertTrue(repo.is_write_locked())
 
1344
            self.addCleanup(repo.unlock)
1349
1345
        self.assertIsInstance(control, bzrdir.BzrDir)
1350
1346
        opened = bzrdir.BzrDir.open(t.base)
1351
1347
        expected_format = self.bzrdir_format