feat: update events remove_targets API response (#3340)
* feat: update events remove_targets API response * test: add missing test for expected exception
This commit is contained in:
parent
3bc18455a2
commit
195ba81c56
3 changed files with 25 additions and 5 deletions
|
|
@ -195,13 +195,27 @@ def test_remove_targets():
|
|||
targets_before = len(targets)
|
||||
assert targets_before > 0
|
||||
|
||||
client.remove_targets(Rule=rule_name, Ids=[targets[0]["Id"]])
|
||||
response = client.remove_targets(Rule=rule_name, Ids=[targets[0]["Id"]])
|
||||
response["FailedEntryCount"].should.equal(0)
|
||||
response["FailedEntries"].should.have.length_of(0)
|
||||
|
||||
targets = client.list_targets_by_rule(Rule=rule_name)["Targets"]
|
||||
targets_after = len(targets)
|
||||
assert targets_before - 1 == targets_after
|
||||
|
||||
|
||||
@mock_events
|
||||
def test_remove_targets_errors():
|
||||
client = boto3.client("events", "us-east-1")
|
||||
|
||||
client.remove_targets.when.called_with(
|
||||
Rule="non-existent", Ids=["Id12345678"]
|
||||
).should.throw(
|
||||
client.exceptions.ResourceNotFoundException,
|
||||
"An entity that you specified does not exist",
|
||||
)
|
||||
|
||||
|
||||
@mock_events
|
||||
def test_put_targets():
|
||||
client = boto3.client("events", "us-west-2")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue