예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
 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)