590
590
def test_no_callback_pointless(self):
591
591
"""Callback should not be invoked for pointless commit"""
592
592
tree = self.make_branch_and_tree('.')
594
594
self.assertRaises(PointlessCommit, tree.commit, message_callback=cb,
596
596
self.assertFalse(cb.called)
598
598
def test_no_callback_netfailure(self):
599
599
"""Callback should not be invoked if connectivity fails"""
600
603
# simulate network failure
602
604
def raise_(self, arg, arg2):
603
605
raise errors.NoSuchFile('foo')
606
606
repository.add_inventory = raise_
607
607
self.assertRaises(errors.NoSuchFile, tree.commit, message_callback=cb)
608
608
self.assertFalse(cb.called)