Add DynamoDB tests for update_item() with UpdateExpression, support spaces in the UpdateExpression. (#758)
Fixes #745.
This commit is contained in:
parent
4942e74ab1
commit
71c1fbadbe
2 changed files with 39 additions and 0 deletions
|
|
@ -419,6 +419,12 @@ class DynamoHandler(BaseResponse):
|
|||
expression_attribute_names = self.body.get('ExpressionAttributeNames', {})
|
||||
expression_attribute_values = self.body.get('ExpressionAttributeValues', {})
|
||||
existing_item = dynamodb_backend2.get_item(name, key)
|
||||
|
||||
# Support spaces between operators in an update expression
|
||||
# E.g. `a = b + c` -> `a=b+c`
|
||||
if update_expression:
|
||||
update_expression = re.sub('\s*([=\+-])\s*', '\\1', update_expression)
|
||||
|
||||
item = dynamodb_backend2.update_item(name, key, update_expression, attribute_updates, expression_attribute_names, expression_attribute_values)
|
||||
|
||||
item_dict = item.to_json()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue