File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111def 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
1717def 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 ]
You can’t perform that action at this time.
0 commit comments