Add basic support for AttributeUpdates in Dynamo update_item. Closes #449.

This commit is contained in:
Steve Pulec 2015-11-07 16:45:24 -05:00
commit 8d41d0019b
3 changed files with 47 additions and 4 deletions

View file

@ -122,6 +122,33 @@ def test_item_add_and_describe_and_update():
})
@requires_boto_gte("2.9")
@mock_dynamodb2
def test_item_partial_save():
table = create_table()
data = {
'forum_name': 'LOLCat Forum',
'Body': 'http://url_to_lolcat.gif',
'SentBy': 'User A',
}
table.put_item(data=data)
returned_item = table.get_item(forum_name="LOLCat Forum")
returned_item['SentBy'] = 'User B'
returned_item.partial_save()
returned_item = table.get_item(
forum_name='LOLCat Forum'
)
dict(returned_item).should.equal({
'forum_name': 'LOLCat Forum',
'Body': 'http://url_to_lolcat.gif',
'SentBy': 'User B',
})
@requires_boto_gte("2.9")
@mock_dynamodb2
def test_item_put_without_table():