@@ -426,6 +426,7 @@ def assert_payload(self, response, response_type):
426426 continue
427427 assert rdict .get (attr ), f"{ attr } is empty"
428428
429+ @patch ("ads.aqua.evaluation.evaluation.get_evaluation_service_config" )
429430 @patch .object (Job , "run" )
430431 @patch ("ads.jobs.ads_job.Job.name" , new_callable = PropertyMock )
431432 @patch ("ads.jobs.ads_job.Job.id" , new_callable = PropertyMock )
@@ -444,6 +445,7 @@ def test_create_evaluation(
444445 mock_job_id ,
445446 mock_job_name ,
446447 mock_job_run ,
448+ mock_get_evaluation_service_config ,
447449 ):
448450 foundation_model = MagicMock ()
449451 foundation_model .display_name = "test_foundation_model"
@@ -473,6 +475,8 @@ def test_create_evaluation(
473475 evaluation_job_run .lifecycle_state = "IN_PROGRESS"
474476 mock_job_run .return_value = evaluation_job_run
475477
478+ mock_get_evaluation_service_config .return_value = EvaluationServiceConfig ()
479+
476480 self .app .ds_client .update_model = MagicMock ()
477481 self .app .ds_client .update_model_provenance = MagicMock ()
478482
@@ -883,8 +887,8 @@ def test_extract_job_lifecycle_details(self, input, expect_output):
883887 msg = self .app ._extract_job_lifecycle_details (input )
884888 assert msg == expect_output , msg
885889
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 ):
888892 """
889893 Tests getting a list of supported metrics for evaluation.
890894 """
@@ -905,16 +909,16 @@ def test_get_supported_metrics(self, mock_evaluation_service_config):
905909 ]
906910 )
907911 )
908- mock_evaluation_service_config .return_value = test_evaluation_service_config
912+ mock_get_evaluation_service_config .return_value = test_evaluation_service_config
909913 response = self .app .get_supported_metrics ()
910914 assert isinstance (response , list )
911915 assert len (response ) == len (test_evaluation_service_config .ui_config .metrics )
912916 assert response == [
913917 item .to_dict () for item in test_evaluation_service_config .ui_config .metrics
914918 ]
915919
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 ):
918922 """
919923 Tests loading default config for evaluation.
920924 This method currently hardcoded the return value.
@@ -952,7 +956,7 @@ def test_load_evaluation_config(self, mock_evaluation_service_config):
952956 ],
953957 )
954958 )
955- mock_evaluation_service_config .return_value = test_evaluation_service_config
959+ mock_get_evaluation_service_config .return_value = test_evaluation_service_config
956960
957961 expected_result = {
958962 "model_params" : {
0 commit comments