#NEWLINE# def __test_copy_log_speced_per_id( self , ztestsuite , localhost_log_file , fetch_logs_flag = True ) : #NEWLINE# #INDENT# '\n    base test method containing common code called by public test methods for testing execution\n    of copy of logs based on function signatures\n    ' #NEWLINE# import tempfile #NEWLINE# runtime . reset_collector ( ) #NEWLINE# with open ( localhost_log_file , 'wb' ) as f : #NEWLINE# #INDENT# f . write ( 'This is a log' ) #NEWLINE# #UNINDENT# runner = TestRunner ( ztestsuite = ztestsuite , config_overrides = { #NEWLINE# #INDENT# 'should_fetch_logs' : fetch_logs_flag , #NEWLINE# #UNINDENT# } ) #NEWLINE# logs_dir = tempfile . mkdtemp ( ) #NEWLINE# runner . set_logs_dir ( ztestsuite ) #NEWLINE# try : #NEWLINE# #INDENT# runner . run ( ) #NEWLINE# if fetch_logs_flag : #NEWLINE# #INDENT# self . assertEqual ( os . listdir ( logs_dir ) , [ ( 'ztestsuite.unittest-' + os . path . basename ( localhost_log_file ) ) ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertEqual ( os . listdir ( logs_dir ) , [ ] ) #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# shutil . rmtree ( logs_dir )