From bfc664cca86e1291e1a78118f8ddcfb58fddc280 Mon Sep 17 00:00:00 2001 From: Nuno Santos Date: Fri, 4 Nov 2016 13:29:53 +0100 Subject: [PATCH] Add additional put_item test with an `attribute_exists` condition. --- .../test_dynamodb2/test_dynamodb_table_with_range_key.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_dynamodb2/test_dynamodb_table_with_range_key.py b/tests/test_dynamodb2/test_dynamodb_table_with_range_key.py index 59251bd48..476ae14f4 100644 --- a/tests/test_dynamodb2/test_dynamodb_table_with_range_key.py +++ b/tests/test_dynamodb2/test_dynamodb_table_with_range_key.py @@ -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')