/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Martin Pool
  • Date: 2010-02-09 19:04:02 UTC
  • mfrom: (5010 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5019.
  • Revision ID: mbp@canonical.com-20100209190402-2xbzrchmb4dfi2j7
Resolve conflicts with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
        b = BzrDir.open_from_transport(self.transport).open_branch()
135
135
        self.assertStartsWith(str(b), 'RemoteBranch(')
136
136
 
 
137
    def test_remote_bzrdir_repr(self):
 
138
        b = BzrDir.open_from_transport(self.transport)
 
139
        self.assertStartsWith(str(b), 'RemoteBzrDir(')
 
140
 
137
141
    def test_remote_branch_format_supports_stacking(self):
138
142
        t = self.transport
139
143
        self.make_branch('unstackable', format='pack-0.92')
440
444
            'BzrDir.cloning_metadir', ('quack/', 'False'),
441
445
            'error', ('BranchReference',)),
442
446
        client.add_expected_call(
443
 
            'BzrDir.open_branchV2', ('quack/',),
 
447
            'BzrDir.open_branchV3', ('quack/',),
444
448
            'success', ('ref', self.get_url('referenced'))),
445
449
        a_bzrdir = RemoteBzrDir(transport, remote.RemoteBzrDirFormat(),
446
450
            _client=client)
531
535
        self.make_branch('.')
532
536
        a_dir = BzrDir.open(self.get_url('.'))
533
537
        self.reset_smart_call_log()
534
 
        verb = 'BzrDir.open_branchV2'
 
538
        verb = 'BzrDir.open_branchV3'
535
539
        self.disable_verb(verb)
536
540
        format = a_dir.open_branch()
537
541
        call_count = len([call for call in self.hpss_calls if
547
551
        transport = transport.clone('quack')
548
552
        client = FakeClient(transport.base)
549
553
        client.add_expected_call(
550
 
            'BzrDir.open_branchV2', ('quack/',),
 
554
            'BzrDir.open_branchV3', ('quack/',),
551
555
            'success', ('branch', branch_network_name))
552
556
        client.add_expected_call(
553
557
            'BzrDir.find_repositoryV3', ('quack/',),
572
576
            _client=client)
573
577
        self.assertRaises(errors.NotBranchError, bzrdir.open_branch)
574
578
        self.assertEqual(
575
 
            [('call', 'BzrDir.open_branchV2', ('quack/',))],
 
579
            [('call', 'BzrDir.open_branchV3', ('quack/',))],
576
580
            client._calls)
577
581
 
578
582
    def test__get_tree_branch(self):
602
606
        network_name = reference_format.network_name()
603
607
        branch_network_name = self.get_branch_format().network_name()
604
608
        client.add_expected_call(
605
 
            'BzrDir.open_branchV2', ('~hello/',),
 
609
            'BzrDir.open_branchV3', ('~hello/',),
606
610
            'success', ('branch', branch_network_name))
607
611
        client.add_expected_call(
608
612
            'BzrDir.find_repositoryV3', ('~hello/',),
1190
1194
        client = FakeClient(self.get_url())
1191
1195
        branch_network_name = self.get_branch_format().network_name()
1192
1196
        client.add_expected_call(
1193
 
            'BzrDir.open_branchV2', ('stacked/',),
 
1197
            'BzrDir.open_branchV3', ('stacked/',),
1194
1198
            'success', ('branch', branch_network_name))
1195
1199
        client.add_expected_call(
1196
1200
            'BzrDir.find_repositoryV3', ('stacked/',),
1226
1230
        client = FakeClient(self.get_url())
1227
1231
        branch_network_name = self.get_branch_format().network_name()
1228
1232
        client.add_expected_call(
1229
 
            'BzrDir.open_branchV2', ('stacked/',),
 
1233
            'BzrDir.open_branchV3', ('stacked/',),
1230
1234
            'success', ('branch', branch_network_name))
1231
1235
        client.add_expected_call(
1232
1236
            'BzrDir.find_repositoryV3', ('stacked/',),
2004
2008
        self.assertLength(1, self.hpss_calls)
2005
2009
 
2006
2010
    def disableExtraResults(self):
2007
 
        old_flag = SmartServerRepositoryGetParentMap.no_extra_results
2008
 
        SmartServerRepositoryGetParentMap.no_extra_results = True
2009
 
        def reset_values():
2010
 
            SmartServerRepositoryGetParentMap.no_extra_results = old_flag
2011
 
        self.addCleanup(reset_values)
 
2011
        self.overrideAttr(SmartServerRepositoryGetParentMap,
 
2012
                          'no_extra_results', True)
2012
2013
 
2013
2014
    def test_null_cached_missing_and_stop_key(self):
2014
2015
        self.setup_smart_server_with_call_log()
2775
2776
        expected_error = errors.NotBranchError(path=bzrdir.root_transport.base)
2776
2777
        self.assertEqual(expected_error, translated_error)
2777
2778
 
 
2779
    def test_nobranch_one_arg(self):
 
2780
        bzrdir = self.make_bzrdir('')
 
2781
        translated_error = self.translateTuple(
 
2782
            ('nobranch', 'extra detail'), bzrdir=bzrdir)
 
2783
        expected_error = errors.NotBranchError(
 
2784
            path=bzrdir.root_transport.base,
 
2785
            detail='extra detail')
 
2786
        self.assertEqual(expected_error, translated_error)
 
2787
 
2778
2788
    def test_LockContention(self):
2779
2789
        translated_error = self.translateTuple(('LockContention',))
2780
2790
        expected_error = errors.LockContention('(remote lock)')