def testDataFromLammps(self): try: main(["-c", COMP_FROM_LAMMPS_INI]) self.assertFalse( diff_lines(COMP_FROM_LAMMPS, COMP_FROM_LAMMPS_GOOD)) finally: silent_remove(COMP_FROM_LAMMPS, disable=DISABLE_REMOVE)
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]]
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 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)
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)
def testImptAtoms(self): try: main(["-c", GLUE_GLUP_IMP_ATOMS_INI]) self.assertFalse(diff_lines(GLUE_SELECT_OUT, GLUE_SELECT_OUT_GOOD)) self.assertFalse(diff_lines(GLUP_SELECT_OUT, GLUP_SELECT_OUT_GOOD)) finally: [ silent_remove(o_file, disable=DISABLE_REMOVE) for o_file in [GLUE_SELECT_OUT, GLUP_SELECT_OUT] ]
def testNoIni(self): main(["-c", "ghost.ini"])
def testDataFromLammps(self): try: main(["-c", COMP_FROM_LAMMPS_INI]) self.assertFalse(diff_lines(COMP_FROM_LAMMPS, COMP_FROM_LAMMPS_GOOD)) finally: silent_remove(COMP_FROM_LAMMPS, disable=DISABLE_REMOVE)
def testCompare(self): try: main(["-c", COMPARE_INI]) self.assertFalse(diff_lines(COMP1_OUT, COMP1_OUT_GOOD)) finally: silent_remove(COMP1_OUT, disable=DISABLE_REMOVE)
def testSort(self): try: main(["-c", SORT_INI]) self.assertFalse(diff_lines(GLUP_SORT_OUT, GLUP_SORT_OUT_GOOD)) finally: silent_remove(GLUP_SORT_OUT, disable=DISABLE_REMOVE)
def testRetype(self): try: main(["-c", RETYPE_INI]) self.assertFalse(diff_lines(GLUP_RETYPE_OUT, GLUP_RETYPE_OUT_GOOD)) finally: silent_remove(GLUP_RETYPE_OUT, disable=DISABLE_REMOVE)
def testDefIni(self): try: main(["-c", DEF_INI]) self.assertFalse(diff_lines(DEF_OUT, GOOD_OUT)) finally: silent_remove(DEF_OUT, disable=DISABLE_REMOVE)
def testGlupIni(self): try: main(["-c", GLUP_INI]) self.assertFalse(diff_lines(GLUP_OUT, GLUP_GOOD_OUT)) finally: silent_remove(GLUP_OUT, disable=DISABLE_REMOVE)