Skip to content

Commit 5090d77

Browse files
committed
fix tests to follow latest changes in parsers
1 parent f7ffd71 commit 5090d77

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

Diff for: tests/cp2k_basisset_parsing.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ def test_single_parse(self):
2020
0.066918004004 0.037148121400 0.438703133000 0.892971208700
2121
0.021708243634 -0.001125195500 -0.059693171300 0.120101316500
2222
"""
23-
23+
2424
parsed = parse_single_cp2k_basisset(content.splitlines())
2525

2626
result = {
2727
'name': 'DZVP-MOLOPT-GTH-q1',
2828
'element': 'H',
29+
'n_el': 1,
2930
'tags': ['DZVP', 'MOLOPT', 'GTH', 'q1'],
30-
'aliases': ['DZVP-MOLOPT-GTH'],
31+
'aliases': ['DZVP-MOLOPT-GTH-q1', 'DZVP-MOLOPT-GTH'],
3132
'blocks': [{
3233
"n": 2,
3334
"l": [(0, 2), (1, 1)],
@@ -61,10 +62,10 @@ def test_roundtrip_single(self):
6162

6263
# ignore the first element since the family name might contain aliases we are not going to write
6364
self.assertEqual(
64-
[l.strip() for l in content.splitlines()[1:]],
65-
[l.lstrip() for l in output.getvalue().splitlines()[1:]]
66-
)
67-
65+
[l.strip() for l in content.splitlines()[1:]], # do not compare the name
66+
[l.lstrip() for l in output.getvalue().splitlines()[2:]] # do not compare the comment or the name
67+
)
68+
6869
def test_roundtrip_multi_shell(self):
6970

7071
with open("tests/BASIS_pob-TZVP.H", 'r') as fhandle:
@@ -76,11 +77,11 @@ def test_roundtrip_multi_shell(self):
7677
write_cp2k_basisset(
7778
output,
7879
**{k: v for k, v in parsed.items() if k in ['element', 'name', 'blocks']},
79-
fmts=("{: > #12.9f}", "{: > #12.9f}") # this basis uses a shorter format
80+
fmts=(" > #12.9f", " > #12.9f") # this basis uses a shorter format
8081
)
8182

8283
# ignore the first element since the family name might contain aliases we are not going to write
8384
self.assertEqual(
84-
[l.strip() for l in content.splitlines()[1:]],
85-
[l.lstrip() for l in output.getvalue().splitlines()[1:]]
86-
)
85+
[l.strip() for l in content.splitlines()[1:]], # do not compare the name
86+
[l.lstrip() for l in output.getvalue().splitlines()[2:]] # do not compare the comment or the name
87+
)

0 commit comments

Comments
 (0)