def testDefInp(self): try: test_input = ["-f", DEF_COMPARE, "-b", DEF_BASE] main(test_input) self.assertFalse(diff_lines(RMSD_OUT, GOOD_RMSD_OUT)) finally: silent_remove(RMSD_OUT, disable=DISABLE_REMOVE)
def testNoArgs(self): test_input = [] if logger.isEnabledFor(logging.DEBUG): main(test_input) with capture_stderr(main, test_input) as output: # Error in looking for ini file self.assertTrue("Problems reading file" 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 testMissingCol(self): test_input = ["-f", MISSING_COMPARE, "-b", DEF_BASE] if logger.isEnabledFor(logging.DEBUG): main(test_input) with capture_stderr(main, test_input) as output: self.assertTrue("Could not find key" in output)
def testNoSuchFile(self): test_input = ["-f", "ghost.csv", "-b", DEF_BASE] if logger.isEnabledFor(logging.DEBUG): main(test_input) with capture_stderr(main, test_input) as output: self.assertTrue("Problems reading file" in output)