~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-24 06:40:26 UTC
  • mfrom: (4160.2.16 bzrdir-open-gaol)
  • Revision ID: pqm@pqm.ubuntu.com-20090324064026-a5a7mmoiaev5mpc9
(andrew) Strengthen the smart server's jail,
        and add ignore_fallbacks parameter to BzrDir.open_branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
408
408
            call.call.method == verb])
409
409
        self.assertEqual(1, call_count)
410
410
 
 
411
    def test_branch_reference(self):
 
412
        transport = self.get_transport('quack')
 
413
        referenced = self.make_branch('referenced')
 
414
        expected = referenced.bzrdir.cloning_metadir()
 
415
        client = FakeClient(transport.base)
 
416
        client.add_expected_call(
 
417
            'BzrDir.cloning_metadir', ('quack/', 'False'),
 
418
            'error', ('BranchReference',)),
 
419
        client.add_expected_call(
 
420
            'BzrDir.open_branchV2', ('quack/',),
 
421
            'success', ('ref', self.get_url('referenced'))),
 
422
        a_bzrdir = RemoteBzrDir(transport, remote.RemoteBzrDirFormat(),
 
423
            _client=client)
 
424
        result = a_bzrdir.cloning_metadir()
 
425
        # We should have got a control dir matching the referenced branch.
 
426
        self.assertEqual(bzrdir.BzrDirMetaFormat1, type(result))
 
427
        self.assertEqual(expected._repository_format, result._repository_format)
 
428
        self.assertEqual(expected._branch_format, result._branch_format)
 
429
        client.finished_test()
 
430
 
411
431
    def test_current_server(self):
412
432
        transport = self.get_transport('.')
413
433
        transport = transport.clone('quack')