/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 breezy/tests/blackbox/test_switch.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-06-01 21:57:00 UTC
  • mfrom: (7490.39.3 move-launchpad)
  • Revision ID: breezy.the.bot@gmail.com-20200601215700-joxuzo6w172gq74v
Move launchpad hoster support to the launchpad plugin.

Merged from https://code.launchpad.net/~jelmer/brz/move-launchpad/+merge/384931

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
from breezy.tests.features import UnicodeFilenameFeature
35
35
from breezy.directory_service import directories
36
36
 
 
37
from breezy.tests.matchers import ContainsNoVfsCalls
 
38
 
37
39
 
38
40
class TestSwitch(TestCaseWithTransport):
39
41
 
474
476
        self.assertEqual(1, opened.count('master'))
475
477
 
476
478
 
 
479
class TestSmartServerSwitch(TestCaseWithTransport):
 
480
 
 
481
    def test_switch_lightweight(self):
 
482
        self.setup_smart_server_with_call_log()
 
483
        t = self.make_branch_and_tree('from')
 
484
        for count in range(9):
 
485
            t.commit(message='commit %d' % count)
 
486
        out, err = self.run_bzr(['checkout', '--lightweight', self.get_url('from'),
 
487
                                 'target'])
 
488
        self.reset_smart_call_log()
 
489
        self.run_bzr(['switch', self.get_url('from')], working_dir='target')
 
490
        # This figure represent the amount of work to perform this use case. It
 
491
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
492
        # being too low. If rpc_count increases, more network roundtrips have
 
493
        # become necessary for this use case. Please do not adjust this number
 
494
        # upwards without agreement from bzr's network support maintainers.
 
495
        self.assertLength(21, self.hpss_calls)
 
496
        self.assertLength(3, self.hpss_connections)
 
497
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
 
498
 
 
499
 
477
500
class TestSwitchUncommitted(TestCaseWithTransport):
478
501
 
479
502
    def prepare(self):