Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Jun 26, 2024
1 parent ca29026 commit 0ea63e6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/vasp/test_outcar.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,25 @@ def test_get_memory_used(self):
memory_usage_dict[int(filename.split("/OUTCAR_")[-1])]
)

def test_get_ediel_sol(self):
ediel_sol_dict = {
1: [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
10: [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
2: [],
3: [],
4: [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
5: [],
6: [],
7: [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
8: [],
9: [0., 0., 0., 0.],
}
for filename in self.file_list:
self.assertTrue(np.all(np.isclose(
self.outcar_parser.get_ediel_sol(filename),
ediel_sol_dict[int(filename.split("/OUTCAR_")[-1])]
)))

def test_get_cpu_time(self):
cpu_time_dict = {
1: 3.543,
Expand Down

0 comments on commit 0ea63e6

Please sign in to comment.