MCPcopy Index your code
hub / github.com/github/copilot-sdk / test_should_delete_session

Method test_should_delete_session

python/e2e/test_session_e2e.py:366–396  ·  view source on GitHub ↗
(self, ctx: E2ETestContext)

Source from the content-addressed store, hash-verified

364 assert isinstance(session_data.context.working_directory, str)
365
366 async def test_should_delete_session(self, ctx: E2ETestContext):
367 import asyncio
368
369 # Create a session and send a message to persist it
370 session = await ctx.client.create_session(
371 on_permission_request=PermissionHandler.approve_all
372 )
373 await session.send_and_wait("Hello")
374 session_id = session.session_id
375
376 # Small delay to ensure session file is written to disk
377 await asyncio.sleep(0.2)
378
379 # Verify session exists in the list
380 sessions = await ctx.client.list_sessions()
381 session_ids = [s.session_id for s in sessions]
382 assert session_id in session_ids
383
384 # Delete the session
385 await ctx.client.delete_session(session_id)
386
387 # Verify session no longer exists in the list
388 sessions_after = await ctx.client.list_sessions()
389 session_ids_after = [s.session_id for s in sessions_after]
390 assert session_id not in session_ids_after
391
392 # Verify we cannot resume the deleted session
393 with pytest.raises(Exception):
394 await ctx.client.resume_session(
395 session_id, on_permission_request=PermissionHandler.approve_all
396 )
397
398 async def test_should_get_session_metadata(self, ctx: E2ETestContext):
399 import asyncio

Callers

nothing calls this directly

Calls 5

create_sessionMethod · 0.80
send_and_waitMethod · 0.80
list_sessionsMethod · 0.80
delete_sessionMethod · 0.80
resume_sessionMethod · 0.80

Tested by

no test coverage detected