|
37 | 37 |
|
38 | 38 | @pytest_asyncio.fixture(scope="module", loop_scope="module") |
39 | 39 | async def session_fs_client(ctx: E2ETestContext): |
40 | | - github_token = "fake-token-for-e2e-tests" if os.environ.get("GITHUB_ACTIONS") == "true" else None |
| 40 | + github_token = ( |
| 41 | + "fake-token-for-e2e-tests" if os.environ.get("GITHUB_ACTIONS") == "true" else None |
| 42 | + ) |
41 | 43 | client = CopilotClient( |
42 | 44 | SubprocessConfig( |
43 | 45 | cli_path=ctx.cli_path, |
@@ -70,7 +72,9 @@ async def test_should_route_file_operations_through_the_session_fs_provider( |
70 | 72 | assert "300" in msg.data.content |
71 | 73 | await session.disconnect() |
72 | 74 |
|
73 | | - events_path = provider_path(provider_root, session.session_id, "/session-state/events.jsonl") |
| 75 | + events_path = provider_path( |
| 76 | + provider_root, session.session_id, "/session-state/events.jsonl" |
| 77 | + ) |
74 | 78 | assert "300" in events_path.read_text(encoding="utf-8") |
75 | 79 |
|
76 | 80 | async def test_should_load_session_data_from_fs_provider_on_resume( |
@@ -106,7 +110,9 @@ async def test_should_load_session_data_from_fs_provider_on_resume( |
106 | 110 | await session2.disconnect() |
107 | 111 |
|
108 | 112 | async def test_should_reject_setprovider_when_sessions_already_exist(self, ctx: E2ETestContext): |
109 | | - github_token = "fake-token-for-e2e-tests" if os.environ.get("GITHUB_ACTIONS") == "true" else None |
| 113 | + github_token = ( |
| 114 | + "fake-token-for-e2e-tests" if os.environ.get("GITHUB_ACTIONS") == "true" else None |
| 115 | + ) |
110 | 116 | client1 = CopilotClient( |
111 | 117 | SubprocessConfig( |
112 | 118 | cli_path=ctx.cli_path, |
@@ -158,7 +164,9 @@ def get_big_string() -> str: |
158 | 164 | tools=[get_big_string], |
159 | 165 | ) |
160 | 166 |
|
161 | | - await session.send_and_wait("Call the get_big_string tool and reply with the word DONE only.") |
| 167 | + await session.send_and_wait( |
| 168 | + "Call the get_big_string tool and reply with the word DONE only." |
| 169 | + ) |
162 | 170 |
|
163 | 171 | messages = await session.get_messages() |
164 | 172 | tool_result = find_tool_call_result(messages, "get_big_string") |
@@ -192,7 +200,9 @@ def on_event(event: SessionEvent): |
192 | 200 |
|
193 | 201 | await session.send_and_wait("What is 2+2?") |
194 | 202 |
|
195 | | - events_path = provider_path(provider_root, session.session_id, "/session-state/events.jsonl") |
| 203 | + events_path = provider_path( |
| 204 | + provider_root, session.session_id, "/session-state/events.jsonl" |
| 205 | + ) |
196 | 206 | await wait_for_path(events_path) |
197 | 207 | assert "checkpointNumber" not in events_path.read_text(encoding="utf-8") |
198 | 208 |
|
@@ -297,7 +307,10 @@ def provider_path(provider_root: Path, session_id: str, path: str) -> Path: |
297 | 307 |
|
298 | 308 | def find_tool_call_result(messages: list[SessionEvent], tool_name: str) -> str | None: |
299 | 309 | for message in messages: |
300 | | - if message.type.value == "tool.execution_complete" and message.data.tool_call_id is not None: |
| 310 | + if ( |
| 311 | + message.type.value == "tool.execution_complete" |
| 312 | + and message.data.tool_call_id is not None |
| 313 | + ): |
301 | 314 | if find_tool_name(messages, message.data.tool_call_id) == tool_name: |
302 | 315 | return message.data.result.content if message.data.result is not None else None |
303 | 316 | return None |
|
0 commit comments