/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/blackbox/test_branch.py

Merge disable-medusa-for-python-2.6 into pyftpdlib

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2008 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2008, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
257
257
            err)
258
258
 
259
259
 
 
260
class TestSmartServerBranching(ExternalBase):
 
261
 
 
262
    def test_branch_from_trivial_branch_to_same_server_branch_acceptance(self):
 
263
        self.setup_smart_server_with_call_log()
 
264
        t = self.make_branch_and_tree('from')
 
265
        for count in range(9):
 
266
            t.commit(message='commit %d' % count)
 
267
        self.reset_smart_call_log()
 
268
        out, err = self.run_bzr(['branch', self.get_url('from'),
 
269
            self.get_url('target')])
 
270
        rpc_count = len(self.hpss_calls)
 
271
        # This figure represent the amount of work to perform this use case. It
 
272
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
273
        # being too low. If rpc_count increases, more network roundtrips have
 
274
        # become necessary for this use case. Please do not adjust this number
 
275
        # upwards without agreement from bzr's network support maintainers.
 
276
        self.assertEqual(53, rpc_count)
 
277
 
 
278
    def test_branch_from_trivial_branch_streaming_acceptance(self):
 
279
        self.setup_smart_server_with_call_log()
 
280
        t = self.make_branch_and_tree('from')
 
281
        for count in range(9):
 
282
            t.commit(message='commit %d' % count)
 
283
        self.reset_smart_call_log()
 
284
        out, err = self.run_bzr(['branch', self.get_url('from'),
 
285
            'local-target'])
 
286
        rpc_count = len(self.hpss_calls)
 
287
        # This figure represent the amount of work to perform this use case. It
 
288
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
289
        # being too low. If rpc_count increases, more network roundtrips have
 
290
        # become necessary for this use case. Please do not adjust this number
 
291
        # upwards without agreement from bzr's network support maintainers.
 
292
        self.assertEqual(10, rpc_count)
 
293
 
 
294
    def test_branch_from_trivial_stacked_branch_streaming_acceptance(self):
 
295
        self.setup_smart_server_with_call_log()
 
296
        t = self.make_branch_and_tree('trunk')
 
297
        for count in range(8):
 
298
            t.commit(message='commit %d' % count)
 
299
        tree2 = t.branch.bzrdir.sprout('feature', stacked=True
 
300
            ).open_workingtree()
 
301
        tree2.commit('feature change')
 
302
        self.reset_smart_call_log()
 
303
        out, err = self.run_bzr(['branch', self.get_url('feature'),
 
304
            'local-target'])
 
305
        rpc_count = len(self.hpss_calls)
 
306
        # This figure represent the amount of work to perform this use case. It
 
307
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
308
        # being too low. If rpc_count increases, more network roundtrips have
 
309
        # become necessary for this use case. Please do not adjust this number
 
310
        # upwards without agreement from bzr's network support maintainers.
 
311
        self.assertEqual(74, rpc_count)
 
312
 
260
313
 
261
314
class TestRemoteBranch(TestCaseWithSFTPServer):
262
315