~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_send.py

(jelmer) Reduce the number of connections made during "bzr branch
 --stacked". (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
 
 
19
import sys
19
20
from cStringIO import StringIO
20
21
 
21
22
from bzrlib import (
28
29
from bzrlib.transport import memory
29
30
from bzrlib.tests import (
30
31
    scenarios,
 
32
    script,
31
33
    )
32
 
from bzrlib.tests.matchers import ContainsNoVfsCalls
33
34
 
34
35
 
35
36
load_tests = scenarios.load_tests_apply_scenarios
438
439
class TestBundleStrictWithoutChanges(TestSendStrictWithoutChanges):
439
440
 
440
441
    _default_command = ['bundle-revisions', '../parent']
441
 
 
442
 
 
443
 
class TestSmartServerSend(tests.TestCaseWithTransport):
444
 
 
445
 
    def test_send(self):
446
 
        self.setup_smart_server_with_call_log()
447
 
        t = self.make_branch_and_tree('branch')
448
 
        self.build_tree_contents([('branch/foo', 'thecontents')])
449
 
        t.add("foo")
450
 
        t.commit("message")
451
 
        local = t.bzrdir.sprout('local-branch').open_workingtree()
452
 
        self.build_tree_contents([('branch/foo', 'thenewcontents')])
453
 
        local.commit("anothermessage")
454
 
        self.reset_smart_call_log()
455
 
        out, err = self.run_bzr(
456
 
            ['send', '-o', 'x.diff', self.get_url('branch')], working_dir='local-branch')
457
 
        # This figure represent the amount of work to perform this use case. It
458
 
        # is entirely ok to reduce this number if a test fails due to rpc_count
459
 
        # being too low. If rpc_count increases, more network roundtrips have
460
 
        # become necessary for this use case. Please do not adjust this number
461
 
        # upwards without agreement from bzr's network support maintainers.
462
 
        self.assertLength(9, self.hpss_calls)
463
 
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)