From 4a0e201fa28f4cf14c202a8f41d11b15b4b9e88e Mon Sep 17 00:00:00 2001 From: JS Ng Date: Tue, 27 Oct 2026 22:56:52 +0800 Subject: [PATCH] fix(test): implement JsonClient.authorization on TestCampusRequest sdk #119 (91d674b) added an abstract authorization property to campus_python's JsonClient ABC, breaking every contract-suite service fixture: patch_campus_python swaps CampusRequest for TestCampusRequest, which did not implement the new member ('Can't instantiate abstract class TestCampusRequest with abstract method authorization'). The stale locally-built sdk in existing venvs had masked the drift (#971). The test double now mirrors the production peek: return the value of the Authorization header that would be sent, without mutating state. --- tests/flask_test/campus_request.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/flask_test/campus_request.py b/tests/flask_test/campus_request.py index dcc5f760..e5c1f9ff 100644 --- a/tests/flask_test/campus_request.py +++ b/tests/flask_test/campus_request.py @@ -203,6 +203,15 @@ def _load_auth_headers(self) -> HttpHeader: # Return empty headers for unauthenticated requests return HttpHeader() + @property + def authorization(self) -> str | None: + """The current Authorization header value, or None when unset. + + Mirrors CampusRequest.authorization (sdk #119): peek the header + that would be sent, without changing client state. + """ + return self.headers.get("Authorization") + def reset_authorization(self) -> None: """Reset authorization back to client credentials from environment.