Esempio n. 1
0
 def test_execute():
     trm = TransactionsManager()
     trh1 = TransactionHandlerMock()
     trh2 = TransactionHandlerMock()
     trm.add_transaction_handler(trh1)
     trm.add_transaction_handler(trh2)
     with trm.begin():
         trm.execute()
     assert trh1.execute.called
     assert trh2.execute.called
Esempio n. 2
0
 def test_execute_not_begun():
     trm = TransactionsManager()
     with pytest.raises(TransactionException):
         trm.execute()