~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

(jelmer) Add HPSS call for ``BzrDir.checkout_metadir``. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
503
503
        self.assertRaises(errors.UnknownFormatError, a_bzrdir.cloning_metadir)
504
504
 
505
505
 
 
506
class TestBzrDirCheckoutMetaDir(TestRemote):
 
507
 
 
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(),
 
519
            _client=client)
 
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)
 
527
 
 
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(),
 
537
            _client=client)
 
538
        self.assertRaises(errors.UnknownFormatError,
 
539
            a_bzrdir.checkout_metadir)
 
540
        self.assertFinished(client)
 
541
 
 
542
 
506
543
class TestBzrDirDestroyBranch(TestRemote):
507
544
 
508
545
    def test_destroy_default(self):