~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-06 06:48:25 UTC
  • mfrom: (4070.8.6 debug-config)
  • Revision ID: pqm@pqm.ubuntu.com-20090306064825-kbpwggw21dygeix6
(mbp) debug_flags configuration option

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
 
18
18
"""Black-box tests for bzr push."""
196
196
        t.commit(allow_pointless=True, message='first commit')
197
197
        self.reset_smart_call_log()
198
198
        self.run_bzr(['push', self.get_url('to-one')], working_dir='from')
 
199
        rpc_count = len(self.hpss_calls)
199
200
        # This figure represent the amount of work to perform this use case. It
200
201
        # is entirely ok to reduce this number if a test fails due to rpc_count
201
202
        # being too low. If rpc_count increases, more network roundtrips have
202
203
        # become necessary for this use case. Please do not adjust this number
203
204
        # upwards without agreement from bzr's network support maintainers.
204
 
        self.assertLength(20, self.hpss_calls)
 
205
        self.assertEqual(23, rpc_count)
205
206
 
206
207
    def test_push_smart_stacked_streaming_acceptance(self):
207
208
        self.setup_smart_server_with_call_log()
212
213
        self.reset_smart_call_log()
213
214
        self.run_bzr(['push', '--stacked', '--stacked-on', '../parent',
214
215
            self.get_url('public')], working_dir='local')
 
216
        rpc_count = len(self.hpss_calls)
215
217
        # This figure represent the amount of work to perform this use case. It
216
218
        # is entirely ok to reduce this number if a test fails due to rpc_count
217
219
        # being too low. If rpc_count increases, more network roundtrips have
218
220
        # become necessary for this use case. Please do not adjust this number
219
221
        # upwards without agreement from bzr's network support maintainers.
220
 
        self.assertLength(42, self.hpss_calls)
 
222
        self.assertEqual(56, rpc_count)
221
223
        remote = Branch.open('public')
222
224
        self.assertEndsWith(remote.get_stacked_on_url(), '/parent')
223
225
 
392
394
        self.assertContainsRe(err,
393
395
                              'Using default stacking branch stack_on at .*')
394
396
 
395
 
    def test_push_stacks_with_default_stacking_if_target_is_stackable(self):
396
 
        self.make_branch('stack_on', format='1.6')
397
 
        self.make_bzrdir('.').get_config().set_default_stack_on('stack_on')
398
 
        self.make_branch('from', format='pack-0.92')
399
 
        out, err = self.run_bzr('push -d from to')
400
 
        branch = Branch.open('to')
401
 
        self.assertEqual('../stack_on', branch.get_stacked_on_url())
402
 
 
403
 
    def test_push_does_not_change_format_with_default_if_target_cannot(self):
404
 
        self.make_branch('stack_on', format='pack-0.92')
405
 
        self.make_bzrdir('.').get_config().set_default_stack_on('stack_on')
406
 
        self.make_branch('from', format='pack-0.92')
407
 
        out, err = self.run_bzr('push -d from to')
408
 
        branch = Branch.open('to')
409
 
        self.assertRaises(errors.UnstackableBranchFormat,
410
 
            branch.get_stacked_on_url)
411
 
 
412
397
    def test_push_doesnt_create_broken_branch(self):
413
398
        """Pushing a new standalone branch works even when there's a default
414
399
        stacking policy at the destination.