Skip to content

Commit acffd2c

Browse files
test(galileo): cover missing organization context
1 parent f3dd6a8 commit acffd2c

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎evaluators/contrib/galileo/tests/test_luna_evaluator.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,30 @@ async def test_evaluator_omits_run_id_for_unsupported_target_type(self) -> None:
12011201
timeout=10.0,
12021202
)
12031203

1204+
@patch.dict(os.environ, LUNA_ENV)
1205+
@pytest.mark.asyncio
1206+
async def test_evaluator_rejects_missing_organization_id(self) -> None:
1207+
from agent_control_evaluator_galileo.luna import LunaEvaluator
1208+
from agent_control_evaluator_galileo.luna.client import GalileoLunaClient
1209+
1210+
evaluator = LunaEvaluator.from_dict({"scorer_id": "scorer-123"})
1211+
extensions = {
1212+
"target_type": "log_stream",
1213+
"target_id": "run-4",
1214+
"metadata": {"project_id": "project-3"},
1215+
}
1216+
1217+
with patch.object(GalileoLunaClient, "invoke", new_callable=AsyncMock) as mock_invoke:
1218+
result = await evaluator.evaluate_with_extensions(
1219+
"selected input",
1220+
Step(type="llm", name="answer", input="prompt"),
1221+
extensions,
1222+
)
1223+
1224+
assert result.error is not None
1225+
assert "organization_id" in result.error
1226+
mock_invoke.assert_not_called()
1227+
12041228
@patch.dict(os.environ, LUNA_ENV)
12051229
@pytest.mark.asyncio
12061230
async def test_evaluator_labels_forwarded_scorer_version_id_as_requested(self) -> None:

0 commit comments

Comments
 (0)