fix server mode test
This commit is contained in:
parent
2a66ae2bfd
commit
6ee204e458
@ -152,7 +152,7 @@ class DynamoHandler(BaseResponse):
|
|||||||
{'server': 'amazon.com'},
|
{'server': 'amazon.com'},
|
||||||
dynamo_json_dump({'__type': er,
|
dynamo_json_dump({'__type': er,
|
||||||
'message': ('One or more parameter values were '
|
'message': ('One or more parameter values were '
|
||||||
'invalid:An AttributeValue may not '
|
'invalid: An AttributeValue may not '
|
||||||
'contain an empty string')}
|
'contain an empty string')}
|
||||||
))
|
))
|
||||||
|
|
||||||
|
@ -163,19 +163,19 @@ def test_item_add_empty_string_exception():
|
|||||||
KeySchema=[{'AttributeName':'forum_name','KeyType':'HASH'}],
|
KeySchema=[{'AttributeName':'forum_name','KeyType':'HASH'}],
|
||||||
AttributeDefinitions=[{'AttributeName':'forum_name','AttributeType':'S'}],
|
AttributeDefinitions=[{'AttributeName':'forum_name','AttributeType':'S'}],
|
||||||
ProvisionedThroughput={'ReadCapacityUnits':5,'WriteCapacityUnits':5})
|
ProvisionedThroughput={'ReadCapacityUnits':5,'WriteCapacityUnits':5})
|
||||||
session = boto3.Session()
|
|
||||||
dynamodb = session.resource('dynamodb',
|
|
||||||
region_name='us-west-2',
|
|
||||||
aws_access_key_id="ak",
|
|
||||||
aws_secret_access_key="sk")
|
|
||||||
table = dynamodb.Table('TestTable')
|
|
||||||
try:
|
try:
|
||||||
response = table.put_item(Item={
|
conn.put_item(
|
||||||
'forum_name': 'LOLCat Forum',
|
TableName=name,
|
||||||
'subject': 'Check this out!',
|
Item={
|
||||||
'Body': 'http://url_to_lolcat.gif',
|
'forum_name': { 'S': 'LOLCat Forum' },
|
||||||
'SentBy': "",
|
'subject': { 'S': 'Check this out!' },
|
||||||
'ReceivedTime': '12/9/2011 11:36:03 PM',
|
'Body': { 'S': 'http://url_to_lolcat.gif'},
|
||||||
})
|
'SentBy': { 'S': "" },
|
||||||
|
'ReceivedTime': { 'S': '12/9/2011 11:36:03 PM'},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
except ClientError as exception:
|
except ClientError as exception:
|
||||||
|
exception.response['Error']['Code']
|
||||||
assert exception.response['Error']['Code'] == "ValidationException"
|
assert exception.response['Error']['Code'] == "ValidationException"
|
||||||
|
Loading…
Reference in New Issue
Block a user