Skip to content

Commit 6b03aae

Browse files
brettcannonCopilot
andcommitted
Add test for None permission handler validation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 84372b7 commit 6b03aae

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

python/test_client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ async def test_create_session_raises_without_permission_handler(self):
2121
finally:
2222
await client.force_stop()
2323

24+
@pytest.mark.asyncio
25+
async def test_create_session_raises_with_none_permission_handler(self):
26+
client = CopilotClient({"cli_path": CLI_PATH})
27+
await client.start()
28+
try:
29+
with pytest.raises(ValueError, match="on_permission_request handler is required"):
30+
await client.create_session(None) # type: ignore[arg-type]
31+
finally:
32+
await client.force_stop()
33+
2434
@pytest.mark.asyncio
2535
async def test_resume_session_raises_without_permission_handler(self):
2636
client = CopilotClient({"cli_path": CLI_PATH})

0 commit comments

Comments
 (0)