File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 1111import dlclibrary
1212import os
1313import pytest
14+ from dlclibrary .dlcmodelzoo .modelzoo_download import MODELOPTIONS
1415
1516
16- def test_download_huggingface_model (tmp_path_factory ):
17- folder = tmp_path_factory .mktemp ("cat " )
18- dlclibrary .download_huggingface_model ("full_cat" , str (folder ))
17+ def test_download_huggingface_model (tmp_path_factory , model = "full_cat" ):
18+ folder = tmp_path_factory .mktemp ("temp " )
19+ dlclibrary .download_huggingface_model (model , str (folder ))
1920
2021 assert os .path .exists (folder / "pose_cfg.yaml" )
21- assert os . path . exists ( folder / "snapshot-75000.meta" )
22+ assert any ( f . startswith ( "snapshot-" ) for f in os . listdir ( folder ) )
2223 # Verify that the Hugging Face folder was removed
2324 assert not any (f .startswith ("models--" ) for f in os .listdir (folder ))
2425
2526
2627def test_download_huggingface_wrong_model ():
2728 with pytest .raises (ValueError ):
2829 dlclibrary .download_huggingface_model ("wrong_model_name" )
30+
31+
32+ @pytest .mark .skip
33+ @pytest .mark .parametrize ("model" , MODELOPTIONS )
34+ def test_download_all_models (tmp_path_factory , model ):
35+ test_download_huggingface_model (tmp_path_factory , model )
You can’t perform that action at this time.
0 commit comments