~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-06 22:06:36 UTC
  • mto: (6437.3.14 2.5)
  • mto: This revision was merged to the branch mainline in revision 6444.
  • Revision ID: jelmer@samba.org-20120106220636-1emawdzrqy3n6n63
Add HPSS call for BzrDir.get_branches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
547
547
        transport = MemoryTransport()
548
548
        client = FakeClient(transport.base)
549
549
        reference_bzrdir_format = bzrdir.format_registry.get('default')()
 
550
        branch_name = reference_bzrdir_format.get_branch_format().network_name()
550
551
        client.add_success_response_with_body(
551
552
            bencode.bencode({
552
 
                "foo": (
553
 
                    "branch", reference_bzrdir_format.get_branch_format().network_name()),
554
 
                "": ("ref", "")}), "success")
 
553
                "foo": ("branch", branch_name),
 
554
                "": ("branch", branch_name)}), "success")
 
555
        client.add_success_response(
 
556
            'ok', '', 'no', 'no', 'no',
 
557
                reference_bzrdir_format.repository_format.network_name())
 
558
        client.add_error_response('NotStacked')
 
559
        client.add_success_response(
 
560
            'ok', '', 'no', 'no', 'no',
 
561
                reference_bzrdir_format.repository_format.network_name())
 
562
        client.add_error_response('NotStacked')
555
563
        transport.mkdir('quack')
556
564
        transport = transport.clone('quack')
557
565
        a_bzrdir = RemoteBzrDir(transport, RemoteBzrDirFormat(),
559
567
        result = a_bzrdir.get_branches()
560
568
        self.assertEquals(["", "foo"], result.keys())
561
569
        self.assertEqual(
562
 
            [('call', 'BzrDir.get_branches', ('quack/',))],
 
570
            [('call_expecting_body', 'BzrDir.get_branches', ('quack/',)),
 
571
             ('call', 'BzrDir.find_repositoryV3', ('quack/', )),
 
572
             ('call', 'Branch.get_stacked_on_url', ('quack/', )),
 
573
             ('call', 'BzrDir.find_repositoryV3', ('quack/', )),
 
574
             ('call', 'Branch.get_stacked_on_url', ('quack/', ))],
563
575
            client._calls)
564
576
 
565
577