def testAbortCallsAbort(self): target = Target() registry.register(target) transaction.abort() self.failUnless(target.abort_called) # _abort removes the TM from the registry self.failIf(registry.contains(target))
def testCommitCallsFinish(self): target = Target() registry.register(target) transaction.commit() self.failUnless(target.finish_called) # _finish removes the TM from the registry self.failIf(registry.contains(target))
def testAbortIsForwarded(self): target = Target() registry.register(target) tm = registry.get(target) tm._abort() self.failUnless(target.abort_called) # _abort removes the TM from the registry self.failIf(registry.contains(target))
def testFinishIsForwarded(self): target = Target() registry.register(target) tm = registry.get(target) tm._finish() self.failUnless(target.finish_called) # _finish removes the TM from the registry self.failIf(registry.contains(target))
def testBeginIsForwarded(self): target = Target() registry.register(target) tm = registry.get(target) tm._begin() self.failUnless(target.begin_called)