Skip to content

Commit

Permalink
opt code
Browse files Browse the repository at this point in the history
  • Loading branch information
Angel-Jia committed Oct 28, 2024
1 parent d0a85d4 commit e3fb42e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_vasp_poscar_to_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ def test_move_flags(self):


class TestPOSCARMoveFlags(unittest.TestCase):
def setUp(self):
self.tmp_file = "POSCAR.tmp.1"

def tearDown(self):
if os.path.exists(self.tmp_file):
os.remove(self.tmp_file)
def test_move_flags_error1(self):
with self.assertRaisesRegex(RuntimeError, "Invalid move flags.*?"):
dpdata.System().from_vasp_poscar(os.path.join("poscars", "POSCAR.oh.err1"))
Expand All @@ -36,7 +42,7 @@ def test_move_flags_error3(self):
with self.assertRaisesRegex(
RuntimeError, "Invalid move flags:.*?should be a list of 3 bools"
):
system.to_vasp_poscar("POSCAR.tmp.1")
system.to_vasp_poscar(self.tmp_file)


class TestPOSCARDirect(unittest.TestCase, TestPOSCARoh):
Expand Down

0 comments on commit e3fb42e

Please sign in to comment.