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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
"""Black-box tests for bzr branch."""
260
class TestSmartServerBranching(ExternalBase):
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
# This figure represent the amount of work to perform this use case. It
271
# is entirely ok to reduce this number if a test fails due to rpc_count
272
# being too low. If rpc_count increases, more network roundtrips have
273
# become necessary for this use case. Please do not adjust this number
274
# upwards without agreement from bzr's network support maintainers.
275
self.assertLength(53, self.hpss_calls)
277
def test_branch_from_trivial_branch_streaming_acceptance(self):
278
self.setup_smart_server_with_call_log()
279
t = self.make_branch_and_tree('from')
280
for count in range(9):
281
t.commit(message='commit %d' % count)
282
self.reset_smart_call_log()
283
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)
261
311
class TestRemoteBranch(TestCaseWithSFTPServer):