From 67e1bb615e8f00d69d57a43cd768bf2a58185f97 Mon Sep 17 00:00:00 2001 From: codgician <15964984+codgician@users.noreply.github.com> Date: Sun, 27 Sep 2026 10:28:09 +0800 Subject: [PATCH] test(router): seed Copilot OAuth token in authenticating-provider tests --- tests/unit/router_strategy/test_complexity_router.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/unit/router_strategy/test_complexity_router.py b/tests/unit/router_strategy/test_complexity_router.py index 3401a335b2f..53f0d8fcd9c 100644 --- a/tests/unit/router_strategy/test_complexity_router.py +++ b/tests/unit/router_strategy/test_complexity_router.py @@ -4979,11 +4979,8 @@ class TestRouterPreRoutingAliasOverrides: string, and model info adopts the declared prefix. The recording wrapper raises for a copilot-directed resolution rather than calling through, so a regression fails on the recorded call instead of hanging the suite in a device-code poll.""" - import json - import time - monkeypatch.setenv("GITHUB_COPILOT_TOKEN_DIR", str(tmp_path)) - (tmp_path / "api-key.json").write_text(json.dumps({"token": "tid=test", "expires_at": int(time.time()) + 3600})) + (tmp_path / "access-token").write_text("gho_test") router = Router( model_list=[ { @@ -14305,11 +14302,8 @@ class TestContextWindowEscalation: """Resolving github_copilot runs its OAuth device flow, so a window question must adopt the declaration instead of resolving: the copilot group reads as unknown-window and the request stays put, with zero copilot resolutions recorded.""" - import json - import time - monkeypatch.setenv("GITHUB_COPILOT_TOKEN_DIR", str(tmp_path)) - (tmp_path / "api-key.json").write_text(json.dumps({"token": "tid=test", "expires_at": int(time.time()) + 3600})) + (tmp_path / "access-token").write_text("gho_test") router = ComplexityRouter( model_name="test-router", litellm_router_instance=Router(