~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2009-04-27 03:34:12 UTC
  • mto: This revision was merged to the branch mainline in revision 4304.
  • Revision ID: robertc@robertcollins.net-20090427033412-3jnnui7ntwib09wa
Review feedback.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1178
1178
            return
1179
1179
        t = self.get_transport('dir')
1180
1180
        t.ensure_base()
1181
 
        self.assertRaises(errors.FileExists, self.assertInitializeEx, t,
 
1181
        self.assertRaises(errors.FileExists,
 
1182
            self.bzrdir_format.initialize_on_transport_ex, t,
1182
1183
            use_existing_dir=False)
1183
1184
 
1184
1185
    def test_format_initialize_on_transport_ex_create_prefix_True(self):
1246
1247
 
1247
1248
    def test_format_initialize_on_transport_ex_repo_fmt_name_followed(self):
1248
1249
        t = self.get_transport('dir')
1249
 
        # 1.6 is likely to neve be default
 
1250
        # 1.6 is likely to never be default
1250
1251
        fmt = bzrdir.format_registry.make_bzrdir('1.6')
1251
1252
        repo_name = fmt.repository_format.network_name()
1252
1253
        repo, control = self.assertInitializeEx(t, repo_format_name=repo_name)
1262
1263
    def assertInitializeEx(self, t, need_meta=False, **kwargs):
1263
1264
        """Execute initialize_on_transport_ex and check it succeeded correctly.
1264
1265
 
 
1266
        This involves checking that the disk objects were created, open with
 
1267
        the same format returned, and had the expected disk format.
 
1268
 
1265
1269
        :param t: The transport to initialize on.
1266
1270
        :param **kwargs: Additional arguments to pass to
1267
1271
            initialize_on_transport_ex.
1276
1280
        opened = bzrdir.BzrDir.open(t.base)
1277
1281
        expected_format = self.bzrdir_format
1278
1282
        if isinstance(expected_format, bzrdir.RemoteBzrDirFormat):
 
1283
            # Current RemoteBzrDirFormat's do not reliably get network_name
 
1284
            # set, so we skip a number of tests for RemoteBzrDirFormat's.
1279
1285
            self.assertIsInstance(control, RemoteBzrDir)
1280
1286
        else:
1281
1287
            if need_meta and isinstance(expected_format, (bzrdir.BzrDirFormat5,
1285
1291
                expected_format = bzrdir.BzrDirMetaFormat1()
1286
1292
            self.assertEqual(control._format.network_name(),
1287
1293
                expected_format.network_name())
1288
 
            # Current RemoteBzrDirFormat's do not reliably get network_name
1289
 
            # set, so only check in the off-case.
1290
1294
            self.assertEqual(control._format.network_name(),
1291
1295
                opened._format.network_name())
1292
1296
        self.assertEqual(control.__class__, opened.__class__)