Fix: broken build with release of botocore 1.19.62 (#3628)

The latest release of `botocore` (1.19.62) makes changes to the parameter
validation code, which for some reason was also covered by a couple of
`moto` tests.

These tests, when run, do not execute any `moto` code.  They fail the
parameter validation check in `botocore`, which raises an exception
before ever sending a request.  These tests do not cover or verify
any `moto` behavior and have been removed.

Ref: ff8ae76ecc

Closes #3627
This commit is contained in:
Brian Pandola 2021-01-29 01:06:25 -08:00 committed by GitHub
parent ef1cb2e544
commit cd25ab7a16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 42 deletions

View File

@ -3,7 +3,7 @@ from __future__ import unicode_literals
import datetime
import boto3
from botocore.exceptions import ClientError, ParamValidationError
from botocore.exceptions import ClientError
import sure # noqa
from moto import mock_sagemaker
@ -122,27 +122,6 @@ def test_create_notebook_instance_params():
assert resp["Tags"] == GENERIC_TAGS_PARAM
@mock_sagemaker
def test_create_notebook_instance_bad_volume_size():
sagemaker = boto3.client("sagemaker", region_name="us-east-1")
vol_size = 2
args = {
"NotebookInstanceName": "MyNotebookInstance",
"InstanceType": "ml.t2.medium",
"RoleArn": FAKE_ROLE_ARN,
"VolumeSizeInGB": vol_size,
}
with pytest.raises(ParamValidationError) as ex:
sagemaker.create_notebook_instance(**args)
assert ex.value.args[
0
] == "Parameter validation failed:\nInvalid range for parameter VolumeSizeInGB, value: {}, valid range: 5-inf".format(
vol_size
)
@mock_sagemaker
def test_create_notebook_instance_invalid_instance_type():

View File

@ -8,7 +8,7 @@ import sure # noqa
import datetime
import uuid
from botocore.exceptions import ClientError, ParamValidationError
from botocore.exceptions import ClientError
import pytest
from moto import mock_ec2, mock_ssm
@ -937,25 +937,6 @@ def test_describe_parameters_invalid_path(value):
msg.should.contain("Valid example: /get/parameters2-/by1./path0_.")
@pytest.mark.parametrize(
"filters,error_msg",
[
([{}], 'Missing required parameter in ParameterFilters[0]: "Key"',),
(
[{"Key": "Name", "Values": []}],
"Invalid length for parameter ParameterFilters[0].Values, value: 0, valid range: 1-inf",
),
],
)
@mock_ssm
def test_describe_parameters_parameter_validation(filters, error_msg):
client = boto3.client("ssm", region_name="us-east-1")
with pytest.raises(ParamValidationError) as e:
client.describe_parameters(ParameterFilters=filters)
e.value.kwargs["report"].should.contain(error_msg)
@mock_ssm
def test_describe_parameters_attributes():
client = boto3.client("ssm", region_name="us-east-1")