forked from github/copilot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_rpc_ui_ephemeral_query_e2e.py
More file actions
33 lines (24 loc) · 1 KB
/
Copy pathtest_rpc_ui_ephemeral_query_e2e.py
File metadata and controls
33 lines (24 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
E2E coverage for session-scoped UI ephemeral query RPC.
Mirrors ``dotnet/test/E2E/RpcUiEphemeralQueryE2ETests.cs`` (snapshot
category ``rpc_ui_ephemeral_query``).
"""
from __future__ import annotations
import pytest
from copilot.rpc import UIEphemeralQueryRequest
from copilot.session import PermissionHandler
from .testharness import E2ETestContext
pytestmark = pytest.mark.asyncio(loop_scope="module")
class TestRpcUiEphemeralQuery:
async def test_should_answer_ephemeral_query(self, ctx: E2ETestContext):
async with await ctx.client.create_session(
on_permission_request=PermissionHandler.approve_all,
) as session:
result = await session.rpc.ui.ephemeral_query(
UIEphemeralQueryRequest(
question="In one word, what is the primary color of a clear daytime sky?"
)
)
assert result is not None
assert (result.answer or "").strip()
assert "blue" in result.answer.lower()