#NEWLINE# @ mock . patch ( 'logging.open' , mock . mock_open ( ) , create = True ) #NEWLINE# @ mock . patch ( 'platform.system' ) #NEWLINE# @ mock . patch ( 'logging.getLogger' ) #NEWLINE# def test_run_logfile_linux( self , getlogger , system ) : #NEWLINE# #INDENT# system . return_value = 'Linux' #NEWLINE# self . opts . logfile = '/dev/null' #NEWLINE# self . logs . run ( self . opts ) #NEWLINE# logger = getlogger . return_value #NEWLINE# self . assertTrue ( logger . addHandler . called ) #NEWLINE# self . assertIsInstance ( logger . addHandler . call_args [ 0 ] [ 0 ] , logging . handlers . WatchedFileHandler )