#NEWLINE# def test_save_key_as_string( self ) : #NEWLINE# #INDENT# with patch . object ( Key , 'set_contents_from_string' ) as set_contents_from_string : #NEWLINE# #INDENT# connection = Mock ( ) #NEWLINE# key = Key ( ) #NEWLINE# contents = 'contents' #NEWLINE# Bucket ( AWS_ACCESS_KEY_ID , AWS_SECRET_ACCESS_KEY , BUCKET_NAME , connection ) . save ( key , contents ) #NEWLINE# set_contents_from_string . assert_called_once_with ( contents )