Skip to content

Commit 60d9f87

Browse files
Varun SharmaCopilot
andcommitted
test: cover empty endpoint path branch in _resolve_endpoint_url
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0172037 commit 60d9f87

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/shared/test_sse.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,12 @@ def test_extract_session_id_from_endpoint(endpoint_url: str, expected: str | Non
278278
"/api/messages/?session_id=abc",
279279
"https://example.com/gw/api/messages/?session_id=abc",
280280
),
281+
# --- Empty path (just /) — no segments to match ---
282+
(
283+
"https://example.com/gw/v1/sse",
284+
"/?session_id=abc",
285+
"https://example.com/?session_id=abc",
286+
),
281287
],
282288
ids=[
283289
"gateway_prefix",
@@ -288,6 +294,7 @@ def test_extract_session_id_from_endpoint(endpoint_url: str, expected: str | Non
288294
"relative_path",
289295
"absolute_url",
290296
"endpoint_at_path_end",
297+
"empty_path_root_slash",
291298
],
292299
)
293300
def test_resolve_endpoint_url(base_url: str, endpoint: str, expected: str) -> None:

0 commit comments

Comments
 (0)