~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(jelmer) Only make a single connection to the submit branch in 'bzr send'.
 (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
20
19
from cStringIO import StringIO
21
20
 
22
21
from bzrlib import (
29
28
from bzrlib.transport import memory
30
29
from bzrlib.tests import (
31
30
    scenarios,
32
 
    script,
33
31
    )
 
32
from bzrlib.tests.matchers import ContainsNoVfsCalls
34
33
 
35
34
 
36
35
load_tests = scenarios.load_tests_apply_scenarios
439
438
class TestBundleStrictWithoutChanges(TestSendStrictWithoutChanges):
440
439
 
441
440
    _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)