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)
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)
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 testDumpList(self): try: main(["-l", DUMP_LIST, "-p", PAIRS_PATH2]) self.assertFalse(diff_lines(DUMP_OUT, GOOD_DUMP_OUT)) finally: silent_remove(DUMP_OUT)
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)
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)
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)
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)