@@ -50,12 +50,13 @@ def test_get_info(self, mock_client: Mock, scorer_view: MockScorerView) -> None:
5050
5151 def test_update (self , mock_client : Mock ) -> None :
5252 """Test update method."""
53- update_response = SimpleNamespace (id = "scorer_123" , name = "updated-scorer " )
53+ update_response = SimpleNamespace (id = "scorer_123" , type = "updated_scorer" , bash_script = "echo 'score=1.0' " )
5454 mock_client .scenarios .scorers .update .return_value = update_response
5555
5656 scorer = Scorer (mock_client , "scorer_123" )
5757 result = scorer .update (
58- name = "updated-scorer" ,
58+ type = "updated_scorer" ,
59+ bash_script = "echo 'score=1.0'" ,
5960 extra_headers = {"X-Custom" : "value" },
6061 extra_query = {"param" : "value" },
6162 extra_body = {"key" : "value" },
@@ -65,7 +66,8 @@ def test_update(self, mock_client: Mock) -> None:
6566 assert result == update_response
6667 mock_client .scenarios .scorers .update .assert_called_once_with (
6768 "scorer_123" ,
68- name = "updated-scorer" ,
69+ type = "updated_scorer" ,
70+ bash_script = "echo 'score=1.0'" ,
6971 extra_headers = {"X-Custom" : "value" },
7072 extra_query = {"param" : "value" },
7173 extra_body = {"key" : "value" },
@@ -75,29 +77,25 @@ def test_update(self, mock_client: Mock) -> None:
7577 def test_validate (self , mock_client : Mock ) -> None :
7678 """Test validate method."""
7779 validate_response = SimpleNamespace (
78- is_valid = True ,
79- score = 0.95 ,
80- reasoning = "The output matches expected criteria." ,
80+ name = "test_scorer" ,
81+ scoring_context = {} ,
82+ scoring_result = SimpleNamespace ( score = 0.95 ) ,
8183 )
8284 mock_client .scenarios .scorers .validate .return_value = validate_response
8385
8486 scorer = Scorer (mock_client , "scorer_123" )
8587 result = scorer .validate (
86- bash_command_output = "test output" ,
87- expected_output = "test output" ,
88+ scoring_context = {"test" : "context" },
8889 extra_headers = {"X-Custom" : "value" },
8990 extra_query = {"param" : "value" },
9091 extra_body = {"key" : "value" },
9192 timeout = 30.0 ,
9293 )
9394
9495 assert result == validate_response
95- assert result .is_valid is True
96- assert result .score == 0.95
9796 mock_client .scenarios .scorers .validate .assert_called_once_with (
9897 "scorer_123" ,
99- bash_command_output = "test output" ,
100- expected_output = "test output" ,
98+ scoring_context = {"test" : "context" },
10199 extra_headers = {"X-Custom" : "value" },
102100 extra_query = {"param" : "value" },
103101 extra_body = {"key" : "value" },
0 commit comments