349
349
self.assertEqual(['r@b-1', 'r@c-2'], b_base.revision_history())
350
350
self.assertEqual(['r@b-1', 'r@c-2'], b_child.revision_history())
352
# TODO: jam 20051230 Test that commit & pull fail when the branch we
353
# are bound to is not available
352
def test_commit_fails(self):
353
b_base, b_child = self.create_branches()
355
wt_child = b_child.working_tree()
356
open('a', 'ab').write('child adds some text\n')
359
os.rename('base', 'hidden_base')
361
self.assertRaises(errors.BoundBranchConnectionFailure,
362
wt_child.commit, 'added text', rev_id='r@c-2')
364
def test_pull_fails(self):
365
b_base, b_child = self.create_branches()
367
b_other = copy_branch(b_child, 'other')
368
wt_other = b_other.working_tree()
369
open('other/a', 'wb').write('new contents\n')
370
wt_other.commit('changed a', rev_id='r@d-2')
372
wt_child = b_child.working_tree()
373
self.assertEqual(['r@b-1'], b_base.revision_history())
374
self.assertEqual(['r@b-1'], b_child.revision_history())
375
self.assertEqual(['r@b-1', 'r@d-2'], b_other.revision_history())
378
os.rename('base', 'hidden_base')
380
self.assertRaises(errors.BoundBranchConnectionFailure,
381
b_child.pull, b_other)
383
# TODO: jam 20051231 We need invasive failure tests, so that we can show
384
# performance even when something fails.
356
387
if not paramiko_loaded: