@@ -426,6 +426,7 @@ def assert_payload(self, response, response_type):
426
426
continue
427
427
assert rdict .get (attr ), f"{ attr } is empty"
428
428
429
+ @patch ("ads.aqua.evaluation.evaluation.get_evaluation_service_config" )
429
430
@patch .object (Job , "run" )
430
431
@patch ("ads.jobs.ads_job.Job.name" , new_callable = PropertyMock )
431
432
@patch ("ads.jobs.ads_job.Job.id" , new_callable = PropertyMock )
@@ -444,6 +445,7 @@ def test_create_evaluation(
444
445
mock_job_id ,
445
446
mock_job_name ,
446
447
mock_job_run ,
448
+ mock_get_evaluation_service_config ,
447
449
):
448
450
foundation_model = MagicMock ()
449
451
foundation_model .display_name = "test_foundation_model"
@@ -473,6 +475,8 @@ def test_create_evaluation(
473
475
evaluation_job_run .lifecycle_state = "IN_PROGRESS"
474
476
mock_job_run .return_value = evaluation_job_run
475
477
478
+ mock_get_evaluation_service_config .return_value = EvaluationServiceConfig ()
479
+
476
480
self .app .ds_client .update_model = MagicMock ()
477
481
self .app .ds_client .update_model_provenance = MagicMock ()
478
482
@@ -883,8 +887,8 @@ def test_extract_job_lifecycle_details(self, input, expect_output):
883
887
msg = self .app ._extract_job_lifecycle_details (input )
884
888
assert msg == expect_output , msg
885
889
886
- @patch ("ads.aqua.evaluation.evaluation.evaluation_service_config " )
887
- def test_get_supported_metrics (self , mock_evaluation_service_config ):
890
+ @patch ("ads.aqua.evaluation.evaluation.get_evaluation_service_config " )
891
+ def test_get_supported_metrics (self , mock_get_evaluation_service_config ):
888
892
"""
889
893
Tests getting a list of supported metrics for evaluation.
890
894
"""
@@ -905,16 +909,16 @@ def test_get_supported_metrics(self, mock_evaluation_service_config):
905
909
]
906
910
)
907
911
)
908
- mock_evaluation_service_config .return_value = test_evaluation_service_config
912
+ mock_get_evaluation_service_config .return_value = test_evaluation_service_config
909
913
response = self .app .get_supported_metrics ()
910
914
assert isinstance (response , list )
911
915
assert len (response ) == len (test_evaluation_service_config .ui_config .metrics )
912
916
assert response == [
913
917
item .to_dict () for item in test_evaluation_service_config .ui_config .metrics
914
918
]
915
919
916
- @patch ("ads.aqua.evaluation.evaluation.evaluation_service_config " )
917
- def test_load_evaluation_config (self , mock_evaluation_service_config ):
920
+ @patch ("ads.aqua.evaluation.evaluation.get_evaluation_service_config " )
921
+ def test_load_evaluation_config (self , mock_get_evaluation_service_config ):
918
922
"""
919
923
Tests loading default config for evaluation.
920
924
This method currently hardcoded the return value.
@@ -952,7 +956,7 @@ def test_load_evaluation_config(self, mock_evaluation_service_config):
952
956
],
953
957
)
954
958
)
955
- mock_evaluation_service_config .return_value = test_evaluation_service_config
959
+ mock_get_evaluation_service_config .return_value = test_evaluation_service_config
956
960
957
961
expected_result = {
958
962
"model_params" : {
0 commit comments