Skip to content

Commit ed6aa65

Browse files
committed
fix bug
1 parent 361f775 commit ed6aa65

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

tests/test_abacus_stru_dump.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,19 @@ def test_dump_spin(self):
145145
5.499851012568 4.003388899277 5.342621842622 0 0 0 mag 3.000000000000 3.000000000000 3.000000000000
146146
"""
147147
self.assertTrue(stru_ref in c)
148-
148+
149149
def test_dump_move_from_vasp(self):
150150
self.system = dpdata.System()
151151
self.system.from_vasp_poscar(os.path.join("poscars", "POSCAR.oh.c"))
152-
self.system.to("abacus/stru", "STRU_tmp")
152+
self.system.to(
153+
"abacus/stru",
154+
"STRU_tmp",
155+
pp_file={"O": "O.upf", "H": "H.upf"},
156+
)
153157
assert os.path.isfile("STRU_tmp")
154158
with open("STRU_tmp") as f:
155159
c = f.read()
156-
160+
157161
stru_ref = """O
158162
0.0
159163
1
@@ -164,12 +168,17 @@ def test_dump_move_from_vasp(self):
164168
1.262185604418 0.701802783513 0.551388341420 0 0 0
165169
"""
166170
self.assertTrue(stru_ref in c)
167-
168-
self.system.to("abacus/stru", "STRU_tmp", move=[[True, False, True], [False, True, False]])
171+
172+
self.system.to(
173+
"abacus/stru",
174+
"STRU_tmp",
175+
pp_file={"O": "O.upf", "H": "H.upf"},
176+
move=[[True, False, True], [False, True, False]],
177+
)
169178
assert os.path.isfile("STRU_tmp")
170179
with open("STRU_tmp") as f:
171180
c = f.read()
172-
181+
173182
stru_ref = """O
174183
0.0
175184
1
@@ -180,9 +189,7 @@ def test_dump_move_from_vasp(self):
180189
1.262185604418 0.701802783513 0.551388341420 0 1 0
181190
"""
182191
self.assertTrue(stru_ref in c)
183-
184-
185-
192+
186193

187194
class TestABACUSParseStru(unittest.TestCase):
188195
def test_parse_stru_post(self):

0 commit comments

Comments
 (0)