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
18
18
"""Black-box tests for bzr branch."""
267
267
self.reset_smart_call_log()
268
268
out, err = self.run_bzr(['branch', self.get_url('from'),
269
269
self.get_url('target')])
270
rpc_count = len(self.hpss_calls)
270
271
# This figure represent the amount of work to perform this use case. It
271
272
# is entirely ok to reduce this number if a test fails due to rpc_count
272
273
# being too low. If rpc_count increases, more network roundtrips have
273
274
# become necessary for this use case. Please do not adjust this number
274
275
# upwards without agreement from bzr's network support maintainers.
275
self.assertLength(53, self.hpss_calls)
276
self.assertEqual(71, rpc_count)
277
278
def test_branch_from_trivial_branch_streaming_acceptance(self):
278
279
self.setup_smart_server_with_call_log()
282
283
self.reset_smart_call_log()
283
284
out, err = self.run_bzr(['branch', self.get_url('from'),
285
# This figure represent the amount of work to perform this use case. It
286
# is entirely ok to reduce this number if a test fails due to rpc_count
287
# being too low. If rpc_count increases, more network roundtrips have
288
# become necessary for this use case. Please do not adjust this number
289
# upwards without agreement from bzr's network support maintainers.
290
self.assertLength(10, self.hpss_calls)
292
def test_branch_from_trivial_stacked_branch_streaming_acceptance(self):
293
self.setup_smart_server_with_call_log()
294
t = self.make_branch_and_tree('trunk')
295
for count in range(8):
296
t.commit(message='commit %d' % count)
297
tree2 = t.branch.bzrdir.sprout('feature', stacked=True
299
tree2.commit('feature change')
300
self.reset_smart_call_log()
301
out, err = self.run_bzr(['branch', self.get_url('feature'),
303
# This figure represent the amount of work to perform this use case. It
304
# is entirely ok to reduce this number if a test fails due to rpc_count
305
# being too low. If rpc_count increases, more network roundtrips have
306
# become necessary for this use case. Please do not adjust this number
307
# upwards without agreement from bzr's network support maintainers.
308
self.assertLength(15, self.hpss_calls)
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(17, rpc_count)
311
295
class TestRemoteBranch(TestCaseWithSFTPServer):