Fix for ReturnValues.

This commit is contained in:
Paul Craciunoiu 2016-01-15 10:23:29 -07:00
commit 4e9f4bfbbf
3 changed files with 10 additions and 3 deletions

View file

@ -859,7 +859,7 @@ def test_update_item_does_not_exist_is_created():
table = _create_table_with_range_key()
item_key = {'forum_name': 'the-key', 'subject': '123'}
table.update_item(
result = table.update_item(
Key=item_key,
AttributeUpdates={
'username': {
@ -875,8 +875,11 @@ def test_update_item_does_not_exist_is_created():
'Value': {'key': 'value'},
}
},
ReturnValues='ALL_OLD',
)
assert not result.get('Attributes')
returned_item = dict((k, str(v) if isinstance(v, Decimal) else v)
for k, v in table.get_item(Key=item_key)['Item'].items())
dict(returned_item).should.equal({

View file

@ -430,7 +430,7 @@ def test_update_item_remove():
}
table.put_item(data=data)
key_map = {
"S": "steve"
'username': {"S": "steve"}
}
# Then remove the SentBy field
@ -455,7 +455,7 @@ def test_update_item_set():
}
table.put_item(data=data)
key_map = {
"S": "steve"
'username': {"S": "steve"}
}
conn.update_item("messages", key_map, update_expression="SET foo=:bar, blah=:baz REMOVE :SentBy")