Fix:update rule (#3734)
* Fix:SQS-message retention period consideration * Fix:SQS-message retention period consideration * Fix:SQS-message retention period consideration * Added comments &linting * Fixed tests * Fix:update rule * Linting and comments
This commit is contained in:
parent
457402fbe2
commit
5c04a4d8cc
2 changed files with 46 additions and 3 deletions
|
|
@ -208,6 +208,37 @@ def test_remove_targets():
|
|||
assert targets_before - 1 == targets_after
|
||||
|
||||
|
||||
@mock_events
|
||||
def test_update_rule_with_targets():
|
||||
client = boto3.client("events", "us-west-2")
|
||||
client.put_rule(
|
||||
Name="test1", ScheduleExpression="rate(5 minutes)", EventPattern="",
|
||||
)
|
||||
|
||||
client.put_targets(
|
||||
Rule="test1",
|
||||
Targets=[
|
||||
{
|
||||
"Id": "test-target-1",
|
||||
"Arn": "arn:aws:lambda:us-west-2:111111111111:function:test-function-1",
|
||||
}
|
||||
],
|
||||
)
|
||||
|
||||
targets = client.list_targets_by_rule(Rule="test1")["Targets"]
|
||||
targets_before = len(targets)
|
||||
assert targets_before == 1
|
||||
|
||||
client.put_rule(
|
||||
Name="test1", ScheduleExpression="rate(1 minute)", EventPattern="",
|
||||
)
|
||||
|
||||
targets = client.list_targets_by_rule(Rule="test1")["Targets"]
|
||||
|
||||
assert len(targets) == 1
|
||||
assert targets[0].get("Id") == "test-target-1"
|
||||
|
||||
|
||||
@mock_events
|
||||
def test_remove_targets_errors():
|
||||
client = boto3.client("events", "us-east-1")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue