本文整理汇总了Python中md_utils.md_common.diff_lines函数的典型用法代码示例。如果您正苦于以下问题:Python diff_lines函数的具体用法?Python diff_lines怎么用?Python diff_lines使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了diff_lines函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testOwnAtoms
def testOwnAtoms(self):
try:
main(["-c", GLUE_GLUP_OWN_ATOMS_INI])
self.assertFalse(diff_lines(GLUE_SELECT_OUT, GLUE_SELECT_OWN_OUT_GOOD))
self.assertFalse(diff_lines(GLUP_SELECT_OUT, GLUP_SELECT_OWN_OUT_GOOD))
finally:
[silent_remove(o_file, disable=DISABLE_REMOVE) for o_file in [GLUE_SELECT_OUT, GLUP_SELECT_OUT]]
示例2: testWaterMol
def testWaterMol(self):
try:
main(["-c", WATER_MOL_INI])
self.assertFalse(diff_lines(WATER_MOL_OUT1, GOOD_WATER_MOL_OUT1))
self.assertFalse(diff_lines(WATER_MOL_OUT2, GOOD_WATER_MOL_OUT2))
finally:
silent_remove(WATER_MOL_OUT1, disable=DISABLE_REMOVE)
silent_remove(WATER_MOL_OUT2, disable=DISABLE_REMOVE)
示例3: testSortFromLammps
def testSortFromLammps(self):
try:
main(["-c", SORT_FROM_LAMMPS_INI])
self.assertFalse(diff_lines(SORT_FROM_LAMMPS, SORT_FROM_LAMMPS_GOOD))
self.assertFalse(diff_lines(SELECT_FROM_LAMMPS, SELECT_FROM_LAMMPS_GOOD))
finally:
silent_remove(SORT_FROM_LAMMPS, disable=DISABLE_REMOVE)
silent_remove(SELECT_FROM_LAMMPS, disable=DISABLE_REMOVE)
示例4: testSpecOverwrite
def testSpecOverwrite(self):
try:
main([str(EXP_TEMP), "-o"])
self.assertFalse(diff_lines(ORIG_WHAM_OUT, GOOD_ORIG_WHAM_OUT))
self.assertFalse(diff_lines(SHORT_WHAM_OUT, GOOD_SHORT_WHAM_OUT))
finally:
silent_remove(ORIG_WHAM_OUT, disable=DISABLE_REMOVE)
silent_remove(SHORT_WHAM_OUT, disable=DISABLE_REMOVE)
示例5: testGood
def testGood(self):
try:
main([PB_GOOD])
self.assertEqual(2, len(diff_lines(PB_GOOD_XYZ, PB_REF_XYZ, delimiter=" ")))
self.assertEqual(0, len(diff_lines(PB_GOOD_LOG, PB_REF_LOG)))
finally:
silent_remove(PB_GOOD_LOG)
silent_remove(PB_GOOD_XYZ)
示例6: testCiInfo
def testCiInfo(self):
try:
main(["-c", CI_INI])
self.assertFalse(diff_lines(DEF_CI_OUT1, GOOD_CI_OUT1))
self.assertEquals(1, len(diff_lines(DEF_CI_OUT2, BAD_CI_OUT2)))
self.assertFalse(diff_lines(DEF_CI_OUT2, GOOD_CI_OUT2))
finally:
silent_remove(DEF_CI_OUT1)
silent_remove(DEF_CI_OUT2)
示例7: testGood
def testGood(self):
try:
# main(["-c", DEF_INI])
with capture_stdout(main, ["-c", DEF_INI]) as output:
self.assertTrue("total charge" in output)
self.assertFalse(diff_lines(VMD_OUT, GOOD_VMD_OUT))
self.assertFalse(diff_lines(WATER_OUT, GOOD_WATER_OUT))
finally:
silent_remove(VMD_OUT)
silent_remove(WATER_OUT)
示例8: testAtomNumTypeDict
def testAtomNumTypeDict(self):
try:
main(["-c", GLUE_GLUP_INI])
self.assertFalse(diff_lines(GLUP_GLUE_ATOM_NUM_DICT, GLUP_GLUE_ATOM_NUM_DICT_GOOD))
self.assertFalse(diff_lines(GLUP_GLUE_ATOM_TYPE_DICT, GLUP_GLUE_ATOM_TYPE_DICT_GOOD))
self.assertFalse(diff_lines(GLUP_AS_GLUE, GLUP_AS_GLUE_GOOD))
finally:
silent_remove(GLUP_GLUE_ATOM_NUM_DICT)
silent_remove(GLUP_GLUE_ATOM_TYPE_DICT)
silent_remove(GLUP_AS_GLUE)
示例9: testPrintQMMM
def testPrintQMMM(self):
try:
main(["-c", QMMM_OUT_INI])
self.assertFalse(diff_lines(QMMM_PDB_OUT, QMMM_PDB_IN))
self.assertFalse(diff_lines(QMMM_OUT, GOOD_QMMM_OUT))
self.assertFalse(diff_lines(VMD_ATOMS_OUT, GOOD_VMD_ATOMS_OUT))
finally:
silent_remove(QMMM_PDB_OUT)
silent_remove(QMMM_OUT)
silent_remove(VMD_ATOMS_OUT)
示例10: testPrintQMMMNoExclude
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
示例11: testHist
def testHist(self):
try:
main(["-f", HIST_INPUT, "-n", "-d", ",", "-s"])
for p_file in [HIST_PNG1, HIST_PNG2, HIST_PNG3]:
self.assertGreater(os.path.getsize(p_file), 10000)
self.assertFalse(diff_lines(HIST_OUT, GOOD_HIST_OUT))
self.assertFalse(diff_lines(HIST_COUNT, GOOD_HIST_COUNT))
finally:
[silent_remove(o_file,
disable=DISABLE_REMOVE) for o_file in [HIST_PNG1, HIST_PNG2, HIST_PNG3,
HIST_OUT, HIST_COUNT, ]]
示例12: testPrintQMMM
def testPrintQMMM(self):
try:
# main(["-c", QMMM_OUT_INI])
with capture_stdout(main, ["-c", QMMM_OUT_INI]) 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)
silent_remove(MM_KIND_OUT)
silent_remove(VMD_ATOMS_OUT)
示例13: testMissingRadius
def testMissingRadius(self):
# Tests both providing a dictionary and not having an available radius (still prints everything, just missing
# one radius)
try:
with capture_stderr(main, ["-c", MISSING_RADIUS_INI]) 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.assertEqual(3, len(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)
silent_remove(MM_KIND_OUT)
silent_remove(VMD_ATOMS_OUT)
示例14: testOneStateEachFileCiInfo
def testOneStateEachFileCiInfo(self):
"""
Make sure can handle input that only has one state (such steps have a vector instead of a matrix)
this time, printing a separate output for each file
And, skip one-state-steps
"""
try:
main(["-c", CI_ONE_STATE_EACH_FILE_INI])
self.assertFalse(diff_lines(DEF_ONE_STATE_OUT, GOOD_ONE_STATE_OUT))
self.assertFalse(diff_lines(DEF_ONE_STATE_OUT2, GOOD_ONE_STATE_OUT2))
finally:
silent_remove(DEF_ONE_STATE_OUT)
silent_remove(DEF_ONE_STATE_OUT2)
示例15: testMultiLineSepIni
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)