#NEWLINE# def test_save_and_load( self ) : #NEWLINE# #INDENT# 'SimpleAssetsManagerTest - Test save and load #1, save and load an image with metadata' #NEWLINE# package = pkg_resources . Requirement . parse ( 'kansha' ) #NEWLINE# test_file = pkg_resources . resource_filename ( package , 'kansha/services/dummyassetsmanager/tie.jpg' ) #NEWLINE# with open ( test_file , 'r' ) as f : #NEWLINE# #INDENT# data = f . read ( ) #NEWLINE# #UNINDENT# file_id = self . dam . save ( data , metadata = { #NEWLINE# #INDENT# 'id' : 'tie.jpg' , #NEWLINE# 'creation_date' : '2013/01/02' , #NEWLINE# #UNINDENT# } ) #NEWLINE# ( res_data , res_metadata ) = self . dam . load ( file_id ) #NEWLINE# self . assertEqual ( res_data , data ) #NEWLINE# self . assertEqual ( res_metadata , { #NEWLINE# #INDENT# 'id' : 'tie.jpg' , #NEWLINE# 'creation_date' : '2013/01/02' , #NEWLINE# #UNINDENT# } )