Example #1
0
 def testPrintQMMMNoExclude(self):
     try:
         main(["-c", QM_OUT_INI])
         self.assertFalse(diff_lines(MM_KIND_OUT, GOOD_MM_KIND_OUT))
         self.assertFalse(diff_lines(QMMM_OUT, GOOD_QM_OUT))
         self.assertFalse(diff_lines(VMD_ATOMS_OUT, GOOD_VMD_QM_ATOMS_OUT))
     finally:
         silent_remove(MM_KIND_OUT, disable=DISABLE_REMOVE)
         silent_remove(QMMM_OUT, disable=DISABLE_REMOVE)
         silent_remove(VMD_ATOMS_OUT, disable=DISABLE_REMOVE)
Example #2
0
 def testPrintQMMMNoExclude(self):
     try:
         main(["-c", QM_OUT_INI])
         self.assertFalse(diff_lines(MM_KIND_OUT, GOOD_MM_KIND_OUT))
         self.assertFalse(diff_lines(QMMM_OUT, GOOD_QM_OUT))
         self.assertFalse(diff_lines(VMD_ATOMS_OUT, GOOD_VMD_QM_ATOMS_OUT))
     finally:
         silent_remove(MM_KIND_OUT)
         silent_remove(QMMM_OUT)
         silent_remove(VMD_ATOMS_OUT)
         pass
Example #3
0
 def testPrintQMMM(self):
     try:
         test_input = ["-c", QMMM_OUT_INI]
         if logger.isEnabledFor(logging.DEBUG):
             main(test_input)
         with capture_stdout(main, test_input) as output:
             self.assertTrue("Total charge from QM atoms: -1.0" in output)
         self.assertFalse(diff_lines(QMMM_OUT, GOOD_QMMM_OUT))
         self.assertFalse(diff_lines(MM_KIND_OUT, GOOD_MM_KIND_OUT))
         self.assertFalse(diff_lines(VMD_ATOMS_OUT, GOOD_VMD_ATOMS_OUT))
     finally:
         silent_remove(QMMM_OUT, disable=DISABLE_REMOVE)
         silent_remove(MM_KIND_OUT, disable=DISABLE_REMOVE)
         silent_remove(VMD_ATOMS_OUT, disable=DISABLE_REMOVE)
Example #4
0
 def testMissingRadius(self):
     # Tests both providing a dictionary and not having an available radius (still prints everything, just missing
     # one radius)
     try:
         test_input = ["-c", MISSING_RADIUS_INI]
         if logger.isEnabledFor(logging.DEBUG):
             main(test_input)
         with capture_stderr(main, test_input) as output:
             self.assertTrue(
                 "Did not find atom type 'XYZ' in the atom_type to radius dictionary"
                 in output)
         self.assertFalse(diff_lines(QMMM_OUT, GOOD_QMMM_OUT))
         self.assertFalse(diff_lines(MM_KIND_OUT, GOOD_MM_KIND_OUT))
         self.assertFalse(diff_lines(VMD_ATOMS_OUT, GOOD_VMD_ATOMS_OUT))
     finally:
         silent_remove(QMMM_OUT, disable=DISABLE_REMOVE)
         silent_remove(MM_KIND_OUT, disable=DISABLE_REMOVE)
         silent_remove(VMD_ATOMS_OUT, disable=DISABLE_REMOVE)
Example #5
0
 def testRenumDictMol(self):
     try:
         main(["-c", MOL_DICT_INI])
         self.assertFalse(diff_lines(DEF_OUT, GOOD_OUT))
     finally:
         silent_remove(DEF_OUT)
Example #6
0
 def testRenumDictMol(self):
     try:
         main(["-c", MOL_DICT_INI])
         self.assertFalse(diff_lines(DEF_OUT, GOOD_OUT))
     finally:
         silent_remove(DEF_OUT, disable=DISABLE_REMOVE)
Example #7
0
 def testRenumMol(self):
     try:
         main(["-c", DEF_INI])
         self.assertFalse(diff_lines(DEF_OUT, GOOD_OUT))
     finally:
         silent_remove(DEF_OUT)
Example #8
0
 def testStringResid(self):
     test_input = ["-c", STRING_RESID_INI]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("expected only integers" in output)
Example #9
0
 def testRenumReorderMol(self):
     test_input = ["-c", MOL_RENUM_REORDER_INI]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("does not currently support both" in output)