Add evaluation of ConditionExpression to DynamoDB2 delete_item

This commit is contained in:
gruebel 2019-10-06 16:49:02 +02:00
commit c9d69681ec
3 changed files with 47 additions and 5 deletions

View file

@ -1995,6 +1995,23 @@ def test_condition_expressions():
},
)
with assert_raises(client.exceptions.ConditionalCheckFailedException):
client.delete_item(
TableName = 'test1',
Key = {
'client': {'S': 'client1'},
'app': {'S': 'app1'},
},
ConditionExpression = 'attribute_not_exists(#existing)',
ExpressionAttributeValues = {
':match': {'S': 'match'}
},
ExpressionAttributeNames = {
'#existing': 'existing',
'#match': 'match',
},
)
@mock_dynamodb2
def test_condition_expression__attr_doesnt_exist():