#NEWLINE# @ mock_dynamodb2 #NEWLINE# def test_update_item_set( ) : #NEWLINE# #INDENT# conn = boto . dynamodb2 . connect_to_region ( 'us-west-2' ) #NEWLINE# table = Table . create ( 'messages' , schema = [ HashKey ( 'username' ) ] ) #NEWLINE# data = { #NEWLINE# #INDENT# 'username' : 'steve' , #NEWLINE# 'SentBy' : 'User A' , #NEWLINE# #UNINDENT# } #NEWLINE# table . put_item ( data = data ) #NEWLINE# key_map = { #NEWLINE# #INDENT# 'username' : { #NEWLINE# #INDENT# 'S' : 'steve' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# conn . update_item ( 'messages' , key_map , update_expression = 'SET foo=:bar, blah=:baz REMOVE :SentBy' ) #NEWLINE# returned_item = table . get_item ( username = 'steve' ) #NEWLINE# dict ( returned_item ) . should . equal ( { #NEWLINE# #INDENT# 'username' : 'steve' , #NEWLINE# 'foo' : 'bar' , #NEWLINE# 'blah' : 'baz' , #NEWLINE# #UNINDENT# } )