ENH: changes the behavior of delete_parameter to respond with a 400 error when the parameter does not exist.

Currently, the delete_parameter function for the ssm client will respond with a dict containing a key of Invalid Parameter which has a value of a list containing the parameter name that was requested to be deleted when a parameter with said name doesn't exist which doesn't match the behavior of boto3.
This commit is contained in:
Olabode Anise 2020-02-25 20:25:44 -05:00
commit 607e0a8452
3 changed files with 22 additions and 5 deletions

View file

@ -30,6 +30,20 @@ def test_delete_parameter():
len(response["Parameters"]).should.equal(0)
@mock_ssm
def test_delete_nonexistent_parameter():
client = boto3.client("ssm", region_name="us-east-1")
try:
client.delete_parameter(Name="test_noexist")
raise RuntimeError("Should of failed")
except botocore.exceptions.ClientError as err:
err.operation_name.should.equal("DeleteParameter")
err.response["Error"]["Message"].should.equal(
"Parameter test_noexist not found."
)
@mock_ssm
def test_delete_parameters():
client = boto3.client("ssm", region_name="us-east-1")