#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# super ( ArtifactFilesDownloaderFlowTest , self ) . setUp ( ) #NEWLINE# with aff4 . FACTORY . Open ( self . client_id , token = self . token , mode = 'rw' ) as fd : #NEWLINE# #INDENT# fd . Set ( fd . Schema . SYSTEM ( 'Windows' ) ) #NEWLINE# kb = fd . Schema . KNOWLEDGE_BASE ( ) #NEWLINE# artifact . SetCoreGRRKnowledgeBaseValues ( kb , fd ) #NEWLINE# fd . Set ( kb ) #NEWLINE# #UNINDENT# self . output_path = 'analysis/artifact_files_downloader' #NEWLINE# self . stubbers = [ ] #NEWLINE# self . collector_replies = [ ] #NEWLINE# def ArtifactCollectorStub( this ) : #NEWLINE# #INDENT# for r in self . collector_replies : #NEWLINE# #INDENT# this . SendReply ( r ) #NEWLINE# #UNINDENT# #UNINDENT# stubber = utils . Stubber ( collectors . ArtifactCollectorFlow , 'Start' , ArtifactCollectorStub ) #NEWLINE# stubber . Start ( ) #NEWLINE# self . stubbers . append ( self ) #NEWLINE# self . start_file_fetch_args = [ ] #NEWLINE# self . received_files = [ ] #NEWLINE# self . failed_files = [ ] #NEWLINE# def StartFileFetch( this , pathspec , request_data = None ) : #NEWLINE# #INDENT# self . start_file_fetch_args . append ( pathspec ) #NEWLINE# for r in self . received_files : #NEWLINE# #INDENT# this . ReceiveFetchedFile ( r , None , request_data = request_data ) #NEWLINE# #UNINDENT# for r in self . failed_files : #NEWLINE# #INDENT# this . FileFetchFailed ( pathspec , 'StatFile' , request_data = request_data ) #NEWLINE# #UNINDENT# #UNINDENT# stubber = utils . Stubber ( transfer . MultiGetFileMixin , 'StartFileFetch' , StartFileFetch ) #NEWLINE# stubber . Start ( ) #NEWLINE# self . stubbers . append ( stubber )