Add additional put_item test with an attribute_exists condition.

This commit is contained in:
Nuno Santos 2016-11-04 13:29:53 +01:00
parent 74b56faafd
commit bfc664cca8

View File

@ -1072,6 +1072,15 @@ def test_boto3_put_item_with_conditions():
ConditionExpression='attribute_not_exists(forum_name) AND attribute_not_exists(subject)'
).should.throw(botocore.exceptions.ClientError)
table.put_item.when.called_with(
Item={
'forum_name': 'bogus-key',
'subject': 'bogus',
'test': '123'
},
ConditionExpression='attribute_exists(forum_name) AND attribute_exists(subject)'
).should.throw(botocore.exceptions.ClientError)
def _create_table_with_range_key():
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')