def testDupCol(self): test_input = ["-f", DUP_COL_CMP_LIST] if logger.isEnabledFor(logging.DEBUG): main(test_input) with capture_stderr(main, test_input) as output: self.assertFalse(diff_lines(DEF_OUT, GOOD_OUT)) self.assertTrue("Non-unique column" in output) silent_remove(DEF_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 testMultiLineSepIni(self): # have different rows create different files # test that if the prefix is already used, number it # test if nothing common in the file base names, number it try: main(["-f", MULTI_LINE_CMP_LIST, "-s", "-l", SUB_DATA_DIR]) self.assertFalse(diff_lines(LINE1_OUT, GOOD_LINE1_OUT)) self.assertFalse(diff_lines(LINE2_OUT, GOOD_LINE2_OUT)) self.assertFalse(diff_lines(LINE3_OUT, GOOD_LINE1_OUT)) self.assertFalse(diff_lines(LINE4_OUT, GOOD_LINE1_OUT)) finally: silent_remove(LINE1_OUT, disable=DISABLE_REMOVE) silent_remove(LINE2_OUT, disable=DISABLE_REMOVE) silent_remove(LINE3_OUT, disable=DISABLE_REMOVE) silent_remove(LINE4_OUT, disable=DISABLE_REMOVE)
def testMultiFileIni(self): try: main(["-f", MULTI_FILE_CMP_LIST]) self.assertFalse(diff_lines(DEF_OUT, GOOD_MULTI_FILE_OUT)) finally: silent_remove(DEF_OUT, disable=DISABLE_REMOVE)
def testDefIni(self): try: main(["-f", DEF_CMP_LIST]) self.assertFalse(diff_lines(DEF_OUT, GOOD_OUT)) finally: silent_remove(DEF_OUT, disable=DISABLE_REMOVE)
def testUnregArg(self): test_input = ['-@@@', "-f", DEF_CMP_LIST] if logger.isEnabledFor(logging.DEBUG): main(test_input) with capture_stderr(main, test_input) as output: self.assertTrue("unrecognized arguments" in output)