getmoto / moto

A library that allows you to easily mock out tests based on AWS infrastructure.

Home Page:http://docs.getmoto.org/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EventBridge Scheduler get_schedule does not include ActionAfterCompletion in response

neilmunday opened this issue · comments

Software versions

moto version: 5.0.9
boto3 version: 1.34.130
Python version: 3.11.7

Problem description

When using the boto3 EventBridgeScheduler client.get_schedule method, the response received when using moto for mocking purposes does not include ActionAfterCompletion in the response.

Expected behaviour

moto's implementation of boto3 EventBridgeScheduler client.get_schedule method should match the response syntax documented by boto3.

How to reproduce

Execute the following code:

#!/usr/bin/env python3

import json
from datetime import datetime

import boto3
import moto

if __name__ == "__main__":

    with moto.mock_aws():

        client = boto3.client("scheduler", region_name="us-east-1")
        client.create_schedule(
            FlexibleTimeWindow={"Mode": "OFF"},
            Name="foo",
            ScheduleExpression="cron(1 0 * * *)",
            StartDate=datetime(2024, 6, 19),
            EndDate=datetime(2024, 6, 26),
            ActionAfterCompletion="DELETE",
            Target={
                "Arn": "arn",
                "Input": json.dumps({"x": True}),
                "RoleArn": "role",
            }
        )

        response = client.get_schedule(Name="foo")
        assert "ActionAfterCompletion" in response

Hi @neilmunday, thanks for raising this. moto >= 5.0.12.dev32 now returns this property.

Many thanks for fixing the issue.