示例#1
0
 def testFileCutoff(self):
     test_input = ["-f", DUMP_CUTOFF_PATH, "-p", PAIRS_PATH]
     try:
         main(test_input)
         self.assertFalse(diff_lines(DUMP_CUTOFF_OUT, GOOD_DUMP_CUTOFF_OUT))
     finally:
         silent_remove(DUMP_CUTOFF_OUT)
示例#2
0
 def testNoSpecifiedPairFile(self):
     test_input = ["-f", DUMP_PATH]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue(
             "No pair file specified and did not find" in output)
示例#3
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)
示例#4
0
 def testDumpList(self):
     try:
         main(["-l", DUMP_LIST, "-p", PAIRS_PATH2])
         self.assertFalse(diff_lines(DUMP_OUT, GOOD_DUMP_OUT))
     finally:
         silent_remove(DUMP_OUT)
示例#5
0
 def testDefault(self):
     try:
         main(["-f", DUMP_PATH, "-p", PAIRS_PATH])
         self.assertFalse(diff_lines(STD_DIST_PATH, DIST_PATH))
     finally:
         silent_remove(DIST_PATH)
示例#6
0
 def testNoSuchFileInList(self):
     test_input = ["-l", GHOST_DUMP_LIST, "-p", PAIRS_PATH]
     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)
示例#7
0
 def testNoSpecifiedFile(self):
     test_input = ["-p", PAIRS_PATH]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("Specify either" in output)
示例#8
0
 def testNoSuchFile(self):
     test_input = ["-f", "ghost", "-p", PAIRS_PATH]
     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)