Remove redundant test code (#3640)

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.
This commit is contained in:
Brian Pandola 2021-01-31 04:21:24 -08:00 committed by GitHub
commit cd044ef00b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 18 additions and 199 deletions

View file

@ -11,7 +11,7 @@ import sure # noqa
from moto import mock_dynamodb2, mock_dynamodb2_deprecated
from moto.dynamodb2 import dynamodb_backend2, dynamodb_backends2
from boto.exception import JSONResponseError
from botocore.exceptions import ClientError, ParamValidationError
from botocore.exceptions import ClientError
from tests.helpers import requires_boto_gte
import moto.dynamodb2.comparisons
@ -4158,35 +4158,6 @@ def test_update_supports_list_append_with_nested_if_not_exists_operation_and_pro
)
@mock_dynamodb2
def test_update_catches_invalid_list_append_operation():
client = boto3.client("dynamodb", region_name="us-east-1")
client.create_table(
AttributeDefinitions=[{"AttributeName": "SHA256", "AttributeType": "S"}],
TableName="TestTable",
KeySchema=[{"AttributeName": "SHA256", "KeyType": "HASH"}],
ProvisionedThroughput={"ReadCapacityUnits": 5, "WriteCapacityUnits": 5},
)
client.put_item(
TableName="TestTable",
Item={"SHA256": {"S": "sha-of-file"}, "crontab": {"L": [{"S": "bar1"}]}},
)
# Update item using invalid list_append expression
with pytest.raises(ParamValidationError) as ex:
client.update_item(
TableName="TestTable",
Key={"SHA256": {"S": "sha-of-file"}},
UpdateExpression="SET crontab = list_append(crontab, :i)",
ExpressionAttributeValues={":i": [{"S": "bar2"}]},
)
# Verify correct error is returned
str(ex.value).should.match("Parameter validation failed:")
str(ex.value).should.match("Invalid type for parameter ExpressionAttributeValues.")
def _create_user_table():
client = boto3.client("dynamodb", region_name="us-east-1")
client.create_table(