I'm trying to run a unit test which mocks the AWS stepfunction client. The initial function runs the following code:
client.start_execution(
stateMachineArn=config.step_function_arn,
input=json.dumps(
dict(
date=date, file=file
)
)
)
And the test looks like this:
from moto import mock_stepfunctions
@mock_stepfunctions
def test_lambda_handler():
function()
I'm not asserting anything yet but when running the test I'm getting the following error:
botocore.errorfactory.StateMachineDoesNotExist: An error occurred (StateMachineDoesNotExist) when calling the StartExecution operation: State Machine Does Not Exist: 'arn:aws:states:ca-central-1:111122223333:stateMachine:test-StateMachine'
I know the test is not communicating with the AWS server, cause that would be a different error. I provided a mock step_function_arn like this "arn:aws:states:ca-central-1:111122223333:stateMachine:test-StateMachine", but I dont think that would matter because if it's really mocked by moto the step_function arn and state machine name wouldn't matter.
So I wonder if my mock is wrong or the setup of my function is wrong.