File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ def test_parse_chargemol(monkeypatch, mock_xyz):
9393
9494
9595def fake_download (self , version : str = "latest" , verbose : bool = True ) -> None :
96+ print ("fake download" )
9697 extraction_path = "~/.cache/pymatgen/ddec"
9798 os .makedirs (os .path .expanduser (extraction_path ), exist_ok = True )
9899
@@ -129,18 +130,17 @@ def test_fake_download_and_modify_path(monkeypatch):
129130 monkeypatch .setattr (
130131 ChargemolAnalysis ,
131132 "_download_and_unzip_atomic_densities" ,
132- lambda self , version , verbose : fake_download (self ),
133+ lambda self : fake_download (self ),
133134 )
134135
135136 # Create an instance of ChargemolAnalysis
136137 test_dir = f"{ TEST_FILES_DIR } /chargemol/spin_unpolarized"
138+
137139 ca = ChargemolAnalysis (
138140 path = test_dir ,
139- # atomic_densities_path=os.path.expanduser("~/.cache/pymatgen/ddec"),
141+ atomic_densities_path = "fake_path" , # force _download_and_unzip_atomic_densities to be called
140142 run_chargemol = False ,
141143 )
142144
143145 # Your assertions
144- assert ca ._atomic_densities_path == os .getcwd ()
145- # assert ca._atomic_densities_path == os.path.expanduser("~/.cache/pymatgen/ddec")
146- # TODO: Add more tests to ensure Chargemol was run correctly
146+ assert ca ._atomic_densities_path == os .path .expanduser ("~/.cache/pymatgen/ddec" )
You can’t perform that action at this time.
0 commit comments