From 8f6a81154c1f6b6bb42eb50f53d78606f1b3d600 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 23 Oct 2025 01:57:17 +0000 Subject: [PATCH] Add JWT base_url validation tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add 2 additional JWT authentication tests: - test_init_with_empty_base_url_raises_error - test_init_with_whitespace_base_url_raises_error Improves JWT auth coverage slightly and adds validation coverage for base_url parameter. Tests: 442 → 444 (+2) Coverage: 79.32% → 79.35% (+0.03%) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- tests/auth/test_jwt.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/auth/test_jwt.py b/tests/auth/test_jwt.py index 5eb81ec..0866ec9 100644 --- a/tests/auth/test_jwt.py +++ b/tests/auth/test_jwt.py @@ -52,6 +52,16 @@ class TestJWTAuth: with pytest.raises(ValueError, match="JWT token cannot be empty"): JWTAuth(None, mock_wiki_base_url) + def test_init_with_empty_base_url_raises_error(self, mock_jwt_token): + """Test that empty base URL raises ValueError.""" + with pytest.raises(ValueError, match="Base URL cannot be empty"): + JWTAuth(mock_jwt_token, "") + + def test_init_with_whitespace_base_url_raises_error(self, mock_jwt_token): + """Test that whitespace-only base URL raises ValueError.""" + with pytest.raises(ValueError, match="Base URL cannot be empty"): + JWTAuth(mock_jwt_token, " ") + def test_get_headers_returns_bearer_token(self, jwt_auth, mock_jwt_token): """Test that get_headers returns proper Authorization header.""" headers = jwt_auth.get_headers()