#NEWLINE# def test_large( self ) : #NEWLINE# #INDENT# parser = ZincAnalysisParser ( ) #NEWLINE# with _temp_test_dir ( 'large.zip' ) as testdir : #NEWLINE# #INDENT# print ( 'Operating in test dir: {}' . format ( testdir ) ) #NEWLINE# analysis_file_names = [ b'downstream.analysis' , b'upstream.analysis' ] #NEWLINE# analysis_files = [ os . path . join ( testdir , f ) for f in analysis_file_names ] #NEWLINE# def msg( prefix ) : #NEWLINE# #INDENT# return '{0} [{1}]' . format ( prefix , ', ' . join ( analysis_file_names ) ) #NEWLINE# #UNINDENT# analyses = self . _time ( ( lambda : [ parser . parse_from_path ( f ) for f in analysis_files ] ) , msg ( 'Parsed' ) ) #NEWLINE# writeout_dir = os . path . join ( testdir , b'write' ) #NEWLINE# os . mkdir ( writeout_dir ) #NEWLINE# def write( file_name , analysis ) : #NEWLINE# #INDENT# outpath = os . path . join ( writeout_dir , file_name ) #NEWLINE# analysis . write_to_path ( outpath ) #NEWLINE# #UNINDENT# def _write_all( ) : #NEWLINE# #INDENT# for ( analysis_file , analysis ) in zip ( analysis_files , analyses ) : #NEWLINE# #INDENT# write ( os . path . basename ( analysis_file ) , analysis ) #NEWLINE# #UNINDENT# #UNINDENT# self . _time ( _write_all , msg ( 'Wrote' ) ) #NEWLINE# merged_analysis = self . _time ( ( lambda : ZincAnalysis . merge ( analyses ) ) , msg ( 'Merged' ) ) #NEWLINE# merged_analysis_path = os . path . join ( testdir , b'merged.analysis' ) #NEWLINE# self . _time ( ( lambda : merged_analysis . write_to_path ( merged_analysis_path ) ) , msg ( 'Wrote merge of' ) ) #NEWLINE# sources_per_analysis = [ a . stamps . sources . keys ( ) for a in analyses ] #NEWLINE# self . _time ( ( lambda : merged_analysis . split ( sources_per_analysis , catchall = True ) ) , msg ( 'Split' ) ) #NEWLINE# rebased_analysis_path = os . path . join ( testdir , b'rebased.merged.analysis' ) #NEWLINE# self . _time ( ( lambda : ZincAnalysisParser ( ) . rebase_from_path ( merged_analysis_path , rebased_analysis_path , b'/Users/kermit/src/acme.web' , b'$PANTS_HOME' ) ) , msg ( 'Rebase' ) ) #NEWLINE# #UNINDENT# print ( ( 'Total time: %f seconds' % self . total_time ) )