1313API_FIXED_HEADER = {"x-api-key" : f"{ config .TEAM_API_KEY } " , "Content-Type" : "application/json" }
1414
1515
16+ @pytest .mark .skip (reason = "Model Upload is deactivated for improvements." )
1617def test_login ():
17- url = urljoin (config .BACKEND_URL , f"sdk/ecr/login" )
18+ url = urljoin (config .BACKEND_URL , f"sdk/ecr/login" )
1819 with requests_mock .Mocker () as mock :
1920 with open (Path ("tests/mock_responses/login_response.json" )) as f :
2021 mock_json = json .load (f )
2122 mock .post (url , headers = AUTH_FIXED_HEADER , json = mock_json )
2223 creds = ModelFactory .asset_repo_login (config .TEAM_API_KEY )
2324 assert creds == mock_json
2425
26+
27+ @pytest .mark .skip (reason = "Model Upload is deactivated for improvements." )
2528def test_create_asset_repo ():
26- url_register = urljoin (config .BACKEND_URL , f"sdk/models/register" )
29+ url_register = urljoin (config .BACKEND_URL , f"sdk/models/register" )
2730 url_function = urljoin (config .BACKEND_URL , f"sdk/functions" )
2831 with requests_mock .Mocker () as mock :
2932 with open (Path ("tests/mock_responses/create_asset_repo_response.json" )) as f :
@@ -32,12 +35,15 @@ def test_create_asset_repo():
3235 with open (Path ("tests/mock_responses/list_functions_response.json" )) as f :
3336 mock_json_functions = json .load (f )
3437 mock .get (url_function , headers = AUTH_FIXED_HEADER , json = mock_json_functions )
35- model_id = ModelFactory .create_asset_repo ("mock_name" , "mock_machines" , "mock_version" ,
36- "mock_description" , "Speech Recognition" , "en" , config .TEAM_API_KEY )
38+ model_id = ModelFactory .create_asset_repo (
39+ "mock_name" , "mock_machines" , "mock_version" , "mock_description" , "Speech Recognition" , "en" , config .TEAM_API_KEY
40+ )
3741 assert model_id == mock_json_register
3842
43+
44+ @pytest .mark .skip (reason = "Model Upload is deactivated for improvements." )
3945def test_list_host_machines ():
40- url = urljoin (config .BACKEND_URL , f"sdk/hosting-machines" )
46+ url = urljoin (config .BACKEND_URL , f"sdk/hosting-machines" )
4147 with requests_mock .Mocker () as mock :
4248 with open (Path ("tests/mock_responses/list_host_machines_response.json" )) as f :
4349 mock_json = json .load (f )
@@ -49,19 +55,22 @@ def test_list_host_machines():
4955 for key in machine_dict .keys ():
5056 assert machine_dict [key ] == mock_json_dict [key ]
5157
58+
59+ @pytest .mark .skip (reason = "Model Upload is deactivated for improvements." )
5260def test_get_functions ():
53- url = urljoin (config .BACKEND_URL , f"sdk/functions" )
61+ url = urljoin (config .BACKEND_URL , f"sdk/functions" )
5462 with requests_mock .Mocker () as mock :
5563 with open (Path ("tests/mock_responses/list_functions_response.json" )) as f :
5664 mock_json = json .load (f )
5765 mock .get (url , headers = AUTH_FIXED_HEADER , json = mock_json )
5866 functions = ModelFactory .list_functions (config .TEAM_API_KEY )
5967 assert functions == mock_json
6068
69+
6170@pytest .mark .skip (reason = "Not currently supported." )
6271def test_list_image_repo_tags ():
6372 model_id = "mock_id"
64- url = urljoin (config .BACKEND_URL , f"sdk/models/{ model_id } /images" )
73+ url = urljoin (config .BACKEND_URL , f"sdk/models/{ model_id } /images" )
6574 with requests_mock .Mocker () as mock :
6675 with open (Path ("tests/mock_responses/list_image_repo_tags_response.json" )) as f :
6776 mock_json = json .load (f )
0 commit comments