Skip to content

Commit 33e4b51

Browse files
committed
add test
1 parent c6bae23 commit 33e4b51

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/test_file.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111
def test_download_file():
1212
get_data(filename="LiFePO4_supercell.cif",folder="data-test")
13-
with open(Path("data-test")/"LiFePO4_supercell.cif", "rb") as f:
14-
h = hashlib.file_digest(f, "sha256")
13+
with open(Path("data-test")/"LiFePO4_supercell.cif", "rb") as fd:
14+
h = hashlib.file_digest(fd, "sha256")
1515
assert h.hexdigest() == "ea9a538dde5bb84b92e9478dbcc078bb560b28a4f5e4b0469d416bff36be272e"
1616

1717
def test_download_files():
1818
files = ["LiFePO4_supercell.cif","h2o.xyz"]
1919
sha256={'LiFePO4_supercell.cif':"ea9a538dde5bb84b92e9478dbcc078bb560b28a4f5e4b0469d416bff36be272e",
2020
'h2o.xyz': "522ab1d36d213e48ab6e08517ec3f648c378d4b9efd257feadc64a1d8f3e66d6"}
21-
get_data(filename=files,,folder="data-test")
21+
get_data(filename=files,folder="data-test")
2222
for f in files:
23-
with open(Path("data-test")/f, "rb") as f:
24-
h = hashlib.file_digest(f, "sha256")
25-
assert h.hexdigest() == sha256['f']
23+
with open(Path("data-test")/f, "rb") as fd:
24+
h = hashlib.file_digest(fd, "sha256")
25+
assert h.hexdigest() == sha256[f]

0 commit comments

Comments
 (0)