示例#1
0
 def testHO_OO_HH_OHGofR(self):
     try:
         main(["-c", HO_OO_HH_OH_GOFR_INI])
         self.assertFalse(
             diff_lines(DEF_GOFR_OUT, GOOD_HO_OO_HH_OH_GOFR_OUT))
     finally:
         silent_remove(DEF_GOFR_OUT, disable=DISABLE_REMOVE)
示例#2
0
 def testFindNoWatH(self):
     test_input = ["-c", WRONG_WAT_H_TYPE_INI]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue(WAT_H_TYPE in output)
         self.assertTrue("no such atoms were found" in output)
示例#3
0
 def testOHDist2(self):
     try:
         main(["-c", OH_DIST_INI2])
         # self.assertFalse(diff_lines(DEF_OUT, GOOD_OH_DIST_OUT))
     finally:
         # silent_remove(DEF_OUT, disable=DISABLE_REMOVE)
         pass
示例#4
0
 def testFindNoWatH(self):
     test_input = ["-c", WRONG_WAT_H_TYPE_INI]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue(WAT_H_TYPE in output)
         self.assertTrue("no such atoms were found" in output)
示例#5
0
 def testCalcProps(self):
     try:
         test_input = ["-c", CALC_GLU_PROPS_INI, "-p"]
         main(test_input)
         self.assertFalse(diff_lines(HIJ_NEW_GLU2_OUT, GOOD_GLU_PROPS_OUT))
     finally:
         silent_remove(HIJ_NEW_GLU2_OUT, disable=DISABLE_REMOVE)
示例#6
0
 def testOHDist(self):
     num = 12
     print(isinstance(num, float))
     try:
         main(["-c", OH_DIST_INI])
         self.assertFalse(diff_lines(DEF_OUT, GOOD_OH_DIST_OUT))
     finally:
         silent_remove(DEF_OUT, disable=DISABLE_REMOVE)
示例#7
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)
示例#8
0
 def testMissingConfig(self):
     test_input = ["-c", INCOMP_INI_PATH]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("Missing config val" in output)
     with capture_stdout(main, test_input) as output:
         self.assertTrue("optional arguments" in output)
示例#9
0
 def testHIJArqNew(self):
     # Test calculating the Maupin form
     try:
         test_input = ["-c", HIJ_NEW_INI]
         main(test_input)
         self.assertFalse(diff_lines(HIJ_ARQ_OUT, GOOD_HIJ_NEW_OUT))
     finally:
         silent_remove(HIJ_ARQ_OUT, disable=DISABLE_REMOVE)
示例#10
0
 def testMissingConfig(self):
     test_input = ["-c", INCOMP_INI_PATH]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("Missing config val for key 'water_o_type'" in output)
     with capture_stdout(main, test_input) as output:
         self.assertTrue("optional arguments" in output)
示例#11
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)
示例#12
0
 def testCombineCECRestrictTimesteps(self):
     try:
         test_input = ["-c", COMBINE_CEC_ONLY_STEPS_INI]
         main(test_input)
         self.assertFalse(
             diff_lines(COMBINE_CEC_ONLY_STEPS_OUT,
                        GOOD_COMBINE_CEC_ONLY_STEPS_OUT))
     finally:
         silent_remove(COMBINE_CEC_ONLY_STEPS_OUT, disable=DISABLE_REMOVE)
示例#13
0
 def testCombineCECMultifile(self):
     try:
         test_input = ["-c", COMBINE_CEC_MULTI_FILE_INI]
         main(test_input)
         self.assertFalse(
             diff_lines(COMBINE_CEC_MULTI_FILE_OUT,
                        GOOD_COMBINE_CEC_MULTI_FILE_OUT))
     finally:
         silent_remove(COMBINE_CEC_MULTI_FILE_OUT, disable=DISABLE_REMOVE)
示例#14
0
 def testHO_OO_HH_OHGofR_MaxSteps(self):
     test_input = ["-c", HO_OO_HH_OH_GOFR_INI_MAX_STEPS]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     try:
         with capture_stdout(main, test_input) as output:
             self.assertTrue(good_long_out_msg in output)
         self.assertFalse(diff_lines(DEF_MAX_STEPS_OUT, GOOD_HO_OO_HH_OH_GOFR_OUT_MAX_STEPS))
     finally:
         silent_remove(DEF_MAX_STEPS_OUT, disable=DISABLE_REMOVE)
示例#15
0
 def testHIJAlt(self):
     try:
         test_input = ["-c", HIJ_ALT_INI]
         if logger.isEnabledFor(logging.DEBUG):
             main(test_input)
         with capture_stderr(main, test_input) as output:
             self.assertTrue("did not have the full list of atom numbers" in output)
         self.assertFalse(diff_lines(HIJ_ALT_OUT, GOOD_HIJ_ALT_OUT))
     finally:
         silent_remove(HIJ_ALT_OUT, disable=DISABLE_REMOVE)
示例#16
0
 def testCombineCEC(self):
     try:
         test_input = ["-c", COMBINE_CEC_INI]
         if logger.isEnabledFor(logging.DEBUG):
             main(test_input)
         with capture_stderr(main, test_input) as output:
             self.assertTrue("Did not find 'timestep' value" in output)
         self.assertFalse(diff_lines(COMBINE_CEC_OUT, GOOD_COMBINE_CEC_OUT))
     finally:
         silent_remove(COMBINE_CEC_OUT, disable=DISABLE_REMOVE)
示例#17
0
 def testHIJArq(self):
     # Test calculating the Maupin form
     try:
         test_input = ["-c", HIJ_ARQ_INI]
         if logger.isEnabledFor(logging.DEBUG):
             main(test_input)
         with capture_stderr(main, test_input) as output:
             self.assertTrue(
                 "did not have the full list of atom numbers" in output)
         self.assertFalse(diff_lines(HIJ_ARQ_OUT, GOOD_HIJ_ARQ_OUT))
     finally:
         silent_remove(HIJ_ARQ_OUT, disable=DISABLE_REMOVE)
示例#18
0
 def testHO_OO_HH_OHGofR_MaxSteps(self):
     test_input = ["-c", HO_OO_HH_OH_GOFR_INI_MAX_STEPS]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     try:
         with capture_stdout(main, test_input) as output:
             self.assertTrue(good_long_out_msg in output)
         self.assertFalse(
             diff_lines(DEF_MAX_STEPS_OUT,
                        GOOD_HO_OO_HH_OH_GOFR_OUT_MAX_STEPS))
     finally:
         silent_remove(DEF_MAX_STEPS_OUT, disable=DISABLE_REMOVE)
示例#19
0
 def testHIJArq6(self):
     # Test calculating the Maupin form
     try:
         test_input = ["-c", HIJ_ARQ6_GLU2_INI, "-p"]
         if logger.isEnabledFor(logging.DEBUG):
             main(test_input)
         # because i've turned off printing, there should be no output
         with capture_stdout(main, test_input) as output:
             self.assertFalse(output)
         self.assertFalse(
             diff_lines(HIJ_NEW_GLU2_OUT, GOOD_HIJ_NEW_GLU2_OUT))
     finally:
         silent_remove(HIJ_NEW_GLU2_OUT, disable=DISABLE_REMOVE)
示例#20
0
 def testMaxTimestepsCalcWatHyd(self):
     try:
         main(["-c", WAT_HYD_INI])
         self.assertFalse(diff_lines(HIJ_OUT, GOOD_WAT_HYD_OUT))
     finally:
         silent_remove(HIJ_OUT, disable=DISABLE_REMOVE)
示例#21
0
 def testHO_OO_HH_OHGofR(self):
     try:
         main(["-c", HO_OO_HH_OH_GOFR_INI])
         self.assertFalse(diff_lines(DEF_GOFR_OUT, GOOD_HO_OO_HH_OH_GOFR_OUT))
     finally:
         silent_remove(DEF_GOFR_OUT, disable=DISABLE_REMOVE)
示例#22
0
 def testOHGofR(self):
     try:
         main(["-c", OH_GOFR_INI_PATH])
         self.assertFalse(diff_lines(DEF_GOFR_OUT, GOOD_OH_GOFR_OUT_PATH))
     finally:
         silent_remove(DEF_GOFR_OUT, disable=DISABLE_REMOVE)
示例#23
0
 def testEmptyList(self):
     test_input = ["-c", EMPTY_LIST_INI]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("Found no dump files to process" in output)
示例#24
0
 def testMissNewHIJMissingParam(self):
     test_input = ["-c", HIJ_NEW_MISS_PARAM_INI]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("Missing input value for key" in output)
示例#25
0
 def testOHGofR(self):
     try:
         main(["-c", OH_GOFR_INI_PATH])
         self.assertFalse(diff_lines(DEF_GOFR_OUT, GOOD_OH_GOFR_OUT_PATH))
     finally:
         silent_remove(DEF_GOFR_OUT, disable=DISABLE_REMOVE)
示例#26
0
 def testMissNewHIJNonfloatParam(self):
     test_input = ["-c", HIJ_NEW_NONFLOAT_PARAM_INI]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("Require float inputs for keys" in output)