22from unittest import mock
33
44import pytest
5- from litmodels .cloud_io import download_model , upload_model , upload_model_files
5+ from litmodels import download_model , upload_model
6+ from litmodels .io import upload_model_file
67from torch .nn import Module
78
89
910@pytest .mark .parametrize ("name" , ["org/model" , "model-name" , "/too/many/slashes" ])
1011def test_wrong_model_name (name ):
1112 with pytest .raises (ValueError , match = r".*organization/teamspace/model.*" ):
12- upload_model_files (path = "path/to/checkpoint" , name = name )
13+ upload_model_file (path = "path/to/checkpoint" , name = name )
1314 with pytest .raises (ValueError , match = r".*organization/teamspace/model.*" ):
1415 download_model (name = name )
1516
@@ -25,7 +26,7 @@ def test_wrong_model_name(name):
2526def test_upload_model (mocker , tmpdir , model , model_path ):
2627 # mocking the _get_teamspace to return another mock
2728 ts_mock = mock .MagicMock ()
28- mocker .patch ("litmodels.cloud_io ._get_teamspace" , return_value = ts_mock )
29+ mocker .patch ("litmodels.io.cloud ._get_teamspace" , return_value = ts_mock )
2930
3031 # The lit-logger function is just a wrapper around the SDK function
3132 upload_model (
0 commit comments