428
430
# This test should be cleaner to write, but see bug:
429
431
# https://bugs.launchpad.net/bzr/+bug/812295
430
432
self.assertEqual(1, opened.count('master'))
435
class TestSmartServerSwitch(TestCaseWithTransport):
437
def test_switch_lightweight(self):
438
self.setup_smart_server_with_call_log()
439
t = self.make_branch_and_tree('from')
440
for count in range(9):
441
t.commit(message='commit %d' % count)
442
out, err = self.run_bzr(['checkout', '--lightweight', self.get_url('from'),
444
self.reset_smart_call_log()
445
self.run_bzr(['switch', self.get_url('from')], working_dir='target')
446
# This figure represent the amount of work to perform this use case. It
447
# is entirely ok to reduce this number if a test fails due to rpc_count
448
# being too low. If rpc_count increases, more network roundtrips have
449
# become necessary for this use case. Please do not adjust this number
450
# upwards without agreement from bzr's network support maintainers.
451
self.assertLength(24, self.hpss_calls)
452
self.assertLength(5, self.hpss_connections)
453
self.assertThat(self.hpss_calls, ContainsNoVfsCalls)