def testLogFile(self): test_input = ["-f", LOG_PATH, "-t"] try: main(test_input) self.assertFalse(diff_lines(LOG_OUT, GOOD_LOG_OUT)) finally: silent_remove(LOG_OUT, disable=DISABLE_REMOVE)
def testHelp(self): test_input = ['-h'] if logger.isEnabledFor(logging.DEBUG): main(test_input) with capture_stderr(main, test_input) as output: self.assertFalse(output) with capture_stdout(main, test_input) as output: self.assertTrue("optional arguments" in output)
def testNoSuchFile(self): test_input = [ "-f", "ghost", ] if logger.isEnabledFor(logging.DEBUG): main(test_input) with capture_stderr(main, test_input) as output: self.assertTrue("Could not find specified log file" in output)
def testNoSuchFileInList(self): test_input = ["-l", GHOST_LOG_LIST] if logger.isEnabledFor(logging.DEBUG): main(test_input) with capture_stderr(main, test_input) as output: self.assertTrue(" No such file or directory" in output)
def testNoSpecifiedFile(self): test_input = [] if logger.isEnabledFor(logging.DEBUG): main(test_input) with capture_stderr(main, test_input) as output: self.assertTrue("Found no log file names to process" in output)