503
503
self.assertRaises(errors.UnknownFormatError, a_bzrdir.cloning_metadir)
506
class TestBzrDirCheckoutMetaDir(TestRemote):
508
def test__get_checkout_format(self):
509
transport = MemoryTransport()
510
client = FakeClient(transport.base)
511
reference_bzrdir_format = bzrdir.format_registry.get('default')()
512
control_name = reference_bzrdir_format.network_name()
513
client.add_expected_call(
514
'BzrDir.checkout_metadir', ('quack/', ),
515
'success', (control_name, '', ''))
516
transport.mkdir('quack')
517
transport = transport.clone('quack')
518
a_bzrdir = RemoteBzrDir(transport, RemoteBzrDirFormat(),
520
result = a_bzrdir.checkout_metadir()
521
# We should have got a reference control dir with default branch and
522
# repository formats.
523
self.assertEqual(bzrdir.BzrDirMetaFormat1, type(result))
524
self.assertEqual(None, result._repository_format)
525
self.assertEqual(None, result._branch_format)
526
self.assertFinished(client)
528
def test_unknown_format(self):
529
transport = MemoryTransport()
530
client = FakeClient(transport.base)
531
client.add_expected_call(
532
'BzrDir.checkout_metadir', ('quack/',),
533
'success', ('dontknow', '', ''))
534
transport.mkdir('quack')
535
transport = transport.clone('quack')
536
a_bzrdir = RemoteBzrDir(transport, RemoteBzrDirFormat(),
538
self.assertRaises(errors.UnknownFormatError,
539
a_bzrdir.checkout_metadir)
540
self.assertFinished(client)
506
543
class TestBzrDirDestroyBranch(TestRemote):
508
545
def test_destroy_default(self):