How to use the stepfunctions.steps.Fail function in stepfunctions

To help you get started, we’ve selected a few stepfunctions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-step-functions-data-science-sdk-python / tests / unit / test_steps.py View on Github external
def test_append_states_after_terminal_state_will_fail():
    with pytest.raises(ValueError):
        chain = Chain()
        chain.append(Pass('Pass'))
        chain.append(Fail('Fail'))
        chain.append(Pass('Pass2'))
    
    with pytest.raises(ValueError):
        chain = Chain()
        chain.append(Pass('Pass'))
        chain.append(Succeed('Succeed'))
        chain.append(Pass('Pass2'))
    
    with pytest.raises(ValueError):
        chain = Chain()
        chain.append(Pass('Pass'))
        chain.append(Choice('Choice'))
        chain.append(Pass('Pass2'))
github aws / aws-step-functions-data-science-sdk-python / tests / unit / test_steps.py View on Github external
def test_fail_creation():
    fail_state = Fail(
        state_id='Fail',
        error='ErrorA',
        cause='Kaiju attack',
        comment='This is a comment'
    )
    assert fail_state.state_id == 'Fail'
    assert fail_state.error == 'ErrorA'
    assert fail_state.cause == 'Kaiju attack'
    assert fail_state.comment == 'This is a comment'
    assert fail_state.to_dict() == {
        'Type': 'Fail',
        'Comment': 'This is a comment',
        'Error': 'ErrorA',
        'Cause': 'Kaiju attack'
    }
github aws / aws-step-functions-data-science-sdk-python / tests / unit / test_steps.py View on Github external
def test_verify_fail_state_fields():
    with pytest.raises(TypeError):
        Fail('Succeed', unknown_field='Unknown Field')