parent
df84675ae6
commit
02edc6fa00
@ -419,16 +419,12 @@ class DynamoHandler(BaseResponse):
|
||||
keys = self.body['Key']
|
||||
return_values = self.body.get('ReturnValues', '')
|
||||
item = dynamodb_backend2.delete_item(name, keys)
|
||||
if item:
|
||||
if return_values == 'ALL_OLD':
|
||||
item_dict = item.to_json()
|
||||
else:
|
||||
item_dict = {'Attributes': {}}
|
||||
item_dict['ConsumedCapacityUnits'] = 0.5
|
||||
return dynamo_json_dump(item_dict)
|
||||
if item and return_values == 'ALL_OLD':
|
||||
item_dict = item.to_json()
|
||||
else:
|
||||
er = 'com.amazonaws.dynamodb.v20120810#ConditionalCheckFailedException'
|
||||
return self.error(er)
|
||||
item_dict = {'Attributes': {}}
|
||||
item_dict['ConsumedCapacityUnits'] = 0.5
|
||||
return dynamo_json_dump(item_dict)
|
||||
|
||||
def update_item(self):
|
||||
name = self.body['TableName']
|
||||
|
@ -314,7 +314,8 @@ def test_delete_item():
|
||||
response.should.equal(True)
|
||||
|
||||
table.count().should.equal(0)
|
||||
item.delete().should.equal(False)
|
||||
# Deletes are idempotent
|
||||
item.delete().should.equal(True)
|
||||
|
||||
|
||||
@requires_boto_gte("2.9")
|
||||
|
Loading…
Reference in New Issue
Block a user