<s> """<STR_LIT>""" <EOL> __all__ = [ '<STR_LIT>' ] <EOL> from google . appengine . api import apiproxy_stub <EOL> from google . appengine . api . files import file_service_pb <EOL> class TestFileServiceStub ( apiproxy_stub . APIProxyStub ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> super ( TestFileServiceStub , self ) . __init__ ( '<STR_LIT:file>' ) <EOL> self . _file_content = { } <EOL> def _Dynamic_Open ( self , request , response ) : <EOL> pass <EOL> def _Dynamic_Close ( self , request , response ) : <EOL> pass <EOL> def _Dynamic_Append ( self , request , response ) : <EOL> self . _file_content [ request . filename ( ) ] = ( <EOL> self . get_content ( request . filename ( ) ) + request . data ( ) ) <EOL> def _Dynamic_Read ( self , request , response ) : <EOL> content = self . _file_content [ request . filename ( ) ] <EOL> pos = request . pos ( ) <EOL> response . set_data ( content [ pos : pos + request . max_bytes ( ) ] ) <EOL> def _Dynamic_Stat ( self , request , response ) : <EOL> file_stat = response . add_stat ( ) <EOL> file_stat . set_length ( len ( self . get_content ( request . filename ( ) ) ) ) <EOL> file_stat . set_filename ( request . filename ( ) ) <EOL> file_stat . set_content_type ( file_service_pb . FileContentType . RAW ) <EOL> file_stat . set_finalized ( True ) <EOL> response . set_more_files_found ( False ) <EOL> def get_content ( self , filename ) : <EOL> """<STR_LIT>""" <EOL> return self . _file_content . get ( filename , '<STR_LIT>' ) <EOL> def set_content ( self , filename , content ) : <EOL> """<STR_LIT>""" <EOL> self . _file_content [ filename ] = content </s>
