Ejemplo n.º 1
0
 def testInputFile(self):
     test_input = ["-c", MISS_KEY_INFO_INI, "-f", FITEVB_OUT]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue(
             "expected comma-separated numerical lower range" in output)
Ejemplo n.º 2
0
 def testSumWOBest(self):
     test_input = ["-c", DA_GAUSS_INI, "-s", ORIG_ALL_BEST]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue(
             "specified, which is required with a specified" in output)
Ejemplo n.º 3
0
 def testMissReqParams(self):
     test_input = ["-c", MISS_GROUP_NAME, "-f", FITEVB_OUT]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue(
             "In configuration file section 'REP1', missing parameter 'group_names'"
             in output)
Ejemplo n.º 4
0
 def testRepExpon2(self):
     try:
         test_input = ["-c", ARQ_REP_EXPON2_INI, FIT_REP_EXPON2]
         main(test_input)
         self.assertFalse(
             diff_lines(SUB_DIR_DEF_OUT, GOOD_ARQ_REP_EXPON2_OUT))
     finally:
         silent_remove(SUB_DIR_DEF_OUT, disable=DISABLE_REMOVE)
Ejemplo n.º 5
0
 def testMissingBest(self):
     test_input = ["-c", DA_GAUSS_INI, "-f", FITEVB_OUT, "-r"]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue(
             "(16) does not equal the total number of values (15)" in
             output)
Ejemplo n.º 6
0
 def testTooManyInFitEVBOut(self):
     test_input = ["-c", DA_GAUSS_INI, "-f", FITEVB_OUT_TOO_MANY]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue(
             "(15) does not equal the total number of values (17)" in
             output)
Ejemplo n.º 7
0
 def testARQ2Fit(self):
     # In the EVB param file, this is option "PT" with "1-asymmetric" (confusing, huh?)
     test_input = ["-c", ARQ2_INI, FIT_HIJ, FIT_REP1]
     try:
         main(test_input)
         self.assertFalse(diff_lines(SUB_DIR_DEF_OUT, GOOD_ARQ2_OUT))
     finally:
         silent_remove(SUB_DIR_DEF_OUT, disable=DISABLE_REMOVE)
Ejemplo n.º 8
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)
Ejemplo n.º 9
0
 def testWithBest(self):
     test_input = [
         "-c", DA_GAUSS_INI, "-f", FITEVB_OUT_RESID, "-r", FIT_REP1, FIT_HIJ
     ]
     try:
         main(test_input)
         self.assertFalse(diff_lines(DEF_OUT, GOOD_NO_VII_FIT_OUT))
     finally:
         silent_remove(DEF_OUT, disable=DISABLE_REMOVE)
Ejemplo n.º 10
0
 def testNoOffDiagFit(self):
     test_input = [
         "-c", NO_OFF_DIAG_INI, "-f", NO_OFF_DIAG_FITEVB_OUT, FIT_REP1
     ]
     try:
         main(test_input)
         self.assertFalse(diff_lines(SUB_DIR_DEF_OUT, GOOD_NO_OFF_DIAG_OUT))
     finally:
         silent_remove(SUB_DIR_DEF_OUT, disable=DISABLE_REMOVE)
Ejemplo n.º 11
0
 def testMissingParam(self):
     test_input = [
         "-c",
         MISS_PARAM_INI,
         "-f",
         FITEVB_OUT,
     ]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("missing parameter" in output)
Ejemplo n.º 12
0
 def testCollectBestWResidNoInitialBest(self):
     try:
         # Ensure that this is not already a summary file
         silent_remove(ALL_BEST_STR, disable=DISABLE_REMOVE)
         main([
             "-c", DA_GAUSS_INI, "-f", FITEVB_OUT1, "-s", ALL_BEST_STR,
             "-r", FIT_HIJ, FIT_REP1
         ])
         self.assertFalse(diff_lines(DEF_OUT, GOOD_INP_OUT1))
         self.assertFalse(diff_lines(ALL_BEST_STR, GOOD_ALL_BEST_NEW))
     finally:
         silent_remove(DEF_OUT, disable=DISABLE_REMOVE)
         silent_remove(ALL_BEST_STR, disable=DISABLE_REMOVE)
Ejemplo n.º 13
0
 def testCollectBestWResid1(self):
     try:
         shutil.copyfile(ORIG_ALL_BEST1, ALL_BEST)
         main([
             "-c", DA_GAUSS_INI, "-f", FITEVB_OUT1, "-s", ALL_BEST, "-r",
             FIT_HIJ, FIT_REP1
         ])
         self.assertFalse(diff_lines(DEF_OUT, GOOD_INP_OUT1))
         self.assertFalse(diff_lines(ALL_BEST, GOOD_ALL_BEST1))
         self.assertFalse(diff_lines(ALL_BEST_CSV, GOOD_ALL_BEST_CSV1))
         self.assertFalse(diff_lines(ALL_BEST_DIFF, GOOD_ALL_BEST_DIFF1))
     finally:
         silent_remove(DEF_OUT, disable=DISABLE_REMOVE)
         silent_remove(ALL_BEST, disable=DISABLE_REMOVE)
         silent_remove(ALL_BEST_CSV, disable=DISABLE_REMOVE)
         silent_remove(ALL_BEST_DIFF, disable=DISABLE_REMOVE)
Ejemplo n.º 14
0
 def testAddSummarySuffix(self):
     try:
         shutil.copyfile(ORIG_ALL_BEST_ARQ2, ALL_BEST)
         main([
             "-c", ARQ7_INI, "-f", FITEVB_ARQ2_BEST, "-s", ALL_BEST, "-r",
             FIT_REP1, FIT_HIJ
         ])
         self.assertFalse(diff_lines(SUB_DIR_DEF_OUT, GOOD_INP_ARQ7_OUT))
         self.assertFalse(diff_lines(ALL_BEST, GOOD_ALL_BEST_ARQ7))
         self.assertFalse(
             diff_lines(SUB_DATA_ALL_BEST_CSV, GOOD_ALL_BEST_ARQ7_CSV))
         # self.assertFalse(diff_lines(SUB_ALL_BEST_DIFF, GOOD_ARQ7_PERC_DIFF))
     finally:
         silent_remove(SUB_DIR_DEF_OUT, disable=DISABLE_REMOVE)
         silent_remove(ALL_BEST, disable=DISABLE_REMOVE)
         silent_remove(SUB_DATA_ALL_BEST_CSV, disable=DISABLE_REMOVE)
         silent_remove(SUB_ALL_BEST_DIFF, disable=DISABLE_REMOVE)
Ejemplo n.º 15
0
 def testViiFit(self):
     try:
         fitevb_setup.main(["-c", INI_PATH, "-f", FITEVB_OUTPUT_PATH, "-v", "True"])
         self.assertFalse(diff_lines(DEF_OUT_PATH, GOOD_VII_FIT_OUT_PATH))
     finally:
         silent_remove(DEF_OUT_PATH)
Ejemplo n.º 16
0
 def testWrongSectionIni(self):
     test_input = ["-c", WRONG_SECTION_INI, "-f", FITEVB_OUT]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("program expects only sections" in output)
Ejemplo n.º 17
0
 def testViiFit(self):
     try:
         main(["-c", DA_GAUSS_INI, "-f", FITEVB_OUT, FIT_VII])
         self.assertFalse(diff_lines(DEF_OUT, GOOD_VII_FIT_OUT))
     finally:
         silent_remove(DEF_OUT, disable=DISABLE_REMOVE)
Ejemplo n.º 18
0
 def testGhostFile(self):
     test_input = ["-c", DA_GAUSS_INI, "-f", GHOST_STR]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("Problems reading specified" in output)
Ejemplo n.º 19
0
 def testNoFitEVBOut(self):
     try:
         main(["-c", DA_GAUSS_INI])
         self.assertFalse(diff_lines(DEF_OUT, GOOD_NO_INITIAL_OUT))
     finally:
         silent_remove(DEF_OUT, disable=DISABLE_REMOVE)
Ejemplo n.º 20
0
 def testExtraParams(self):
     test_input = ["-c", MISS_SEC_INI, "-f", FITEVB_OUT]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("already exists" in output)
Ejemplo n.º 21
0
 def testGhostDir(self):
     test_input = ["-c", BAD_DIR_INI, "-f", FITEVB_OUT]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("Invalid directory" in output)