Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 28, 2024
1 parent 0222d6d commit 6362d98
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_vasp_poscar_to_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,22 @@ class TestPOSCARCart(unittest.TestCase):
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"))

def test_move_flags_error2(self):
with self.assertRaisesRegex(RuntimeError, "Invalid move flag: a"):
dpdata.System().from_vasp_poscar(os.path.join("poscars", "POSCAR.oh.err2"))

def test_move_flags_error3(self):
system = dpdata.System().from_vasp_poscar(os.path.join("poscars", "POSCAR.oh.c"))
system = dpdata.System().from_vasp_poscar(
os.path.join("poscars", "POSCAR.oh.c")
)
system.data["move"] = np.array([[[True, True], [False, False]]])
with self.assertRaisesRegex(RuntimeError, "Invalid move flags:.*?should be a list of 3 bools"):
with self.assertRaisesRegex(
RuntimeError, "Invalid move flags:.*?should be a list of 3 bools"
):
system.to_vasp_poscar("POSCAR.tmp.1")


class TestPOSCARDirect(unittest.TestCase, TestPOSCARoh):
def setUp(self):
self.system = dpdata.System()
Expand Down

0 comments on commit 6362d98

Please sign in to comment.