Ejemplo n.º 1
0
 def test_rollback_no_pipeline():
     pth = PipelineTransactionHandler()
     with pytest.raises(TransactionException):
         pth.rollback()
Ejemplo n.º 2
0
 def test_execute_no_pipeline():
     pth = PipelineTransactionHandler()
     with pytest.raises(TransactionException):
         pth.execute()
Ejemplo n.º 3
0
 def test_rollback():
     pipeline = ActionsPipelineMock()
     pth = PipelineTransactionHandler(pipeline)
     pth.rollback()
     assert not pipeline.do.called
     assert pipeline.undo.called
Ejemplo n.º 4
0
 def test_prepare_commit():
     pth = PipelineTransactionHandler()
     assert pth.prepare_commit()
Ejemplo n.º 5
0
 def test_pipeline_name_setter():
     pth = PipelineTransactionHandler()
     with pytest.raises(TransactionException):
         pth.pipeline_name = "pipeline_name"
Ejemplo n.º 6
0
 def test_pipeline_name():
     pth = PipelineTransactionHandler(ActionsPipelineMock("pipeline_name"))
     assert pth.pipeline_name == "pipeline_name"
Ejemplo n.º 7
0
 def test_actions_pipeline():
     pth = PipelineTransactionHandler()
     pipeline = ActionsPipelineMock()
     pth.actions_pipeline = pipeline
     assert pth.actions_pipeline == pipeline
Ejemplo n.º 8
0
 def test_init():
     assert PipelineTransactionHandler(ActionsPipelineMock())