-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathtest_rpc_schedule_e2e.py
More file actions
37 lines (29 loc) · 1.19 KB
/
test_rpc_schedule_e2e.py
File metadata and controls
37 lines (29 loc) · 1.19 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
34
35
36
37
"""E2E coverage for session.schedule RPC methods."""
from __future__ import annotations
import pytest
from copilot.generated.rpc import ScheduleStopRequest
from copilot.session import PermissionHandler
from .testharness import E2ETestContext
pytestmark = pytest.mark.asyncio(loop_scope="module")
class TestRpcSchedule:
async def test_should_list_no_schedules_for_fresh_session(self, ctx: E2ETestContext):
session = await ctx.client.create_session(
on_permission_request=PermissionHandler.approve_all,
)
try:
result = await session.rpc.schedule.list()
assert result.entries == []
finally:
await session.disconnect()
async def test_should_return_null_entry_when_stopping_unknown_schedule(
self, ctx: E2ETestContext
):
session = await ctx.client.create_session(
on_permission_request=PermissionHandler.approve_all,
)
try:
result = await session.rpc.schedule.stop(ScheduleStopRequest(id=2_147_483_647))
assert result.entry is None
assert (await session.rpc.schedule.list()).entries == []
finally:
await session.disconnect()