Skip to content

Commit 5c87fb3

Browse files
committed
test
1 parent 2132cde commit 5c87fb3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/client/test_auth.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ async def test_init(self, oauth_provider, client_metadata, mock_storage):
156156
assert oauth_provider.storage == mock_storage
157157
assert oauth_provider.timeout == 300.0
158158

159+
@pytest.mark.anyio
159160
def test_generate_code_verifier(self, oauth_provider):
160161
"""Test PKCE code verifier generation."""
161162
verifier = oauth_provider._generate_code_verifier()
@@ -173,6 +174,7 @@ def test_generate_code_verifier(self, oauth_provider):
173174
verifiers = {oauth_provider._generate_code_verifier() for _ in range(10)}
174175
assert len(verifiers) == 10
175176

177+
@pytest.mark.anyio
176178
def test_generate_code_challenge(self, oauth_provider):
177179
"""Test PKCE code challenge generation."""
178180
verifier = "test_code_verifier_123"
@@ -191,6 +193,7 @@ def test_generate_code_challenge(self, oauth_provider):
191193
assert "+" not in challenge
192194
assert "/" not in challenge
193195

196+
@pytest.mark.anyio
194197
def test_get_authorization_base_url(self, oauth_provider):
195198
"""Test authorization base URL extraction."""
196199
# Test with path
@@ -366,10 +369,12 @@ async def test_register_oauth_client_failure(self, oauth_provider):
366369
None,
367370
)
368371

372+
@pytest.mark.anyio
369373
def test_has_valid_token_no_token(self, oauth_provider):
370374
"""Test token validation with no token."""
371375
assert not oauth_provider._has_valid_token()
372376

377+
@pytest.mark.anyio
373378
def test_has_valid_token_valid(self, oauth_provider, oauth_token):
374379
"""Test token validation with valid token."""
375380
oauth_provider._current_tokens = oauth_token
@@ -774,6 +779,7 @@ async def test_async_auth_flow_no_token(self, oauth_provider):
774779
# No Authorization header should be added if no token
775780
assert "Authorization" not in updated_request.headers
776781

782+
@pytest.mark.anyio
777783
def test_scope_priority_client_metadata_first(
778784
self, oauth_provider, oauth_client_info
779785
):
@@ -803,6 +809,7 @@ def test_scope_priority_client_metadata_first(
803809

804810
assert auth_params["scope"] == "read write"
805811

812+
@pytest.mark.anyio
806813
def test_scope_priority_no_client_metadata_scope(
807814
self, oauth_provider, oauth_client_info
808815
):

0 commit comments

Comments
 (0)