Skip to content

Commit 9bae21d

Browse files
committed
Fix pytest init error
1 parent 032ff50 commit 9bae21d

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

tests/client/auth/extensions/test_client_credentials.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,29 @@
22

33
import jwt
44
import pytest
5-
from client.test_auth import MockTokenStorage
65

76
from mcp.client.auth.extensions.client_credentials import JWTParameters, RFC7523OAuthClientProvider
8-
from mcp.shared.auth import OAuthClientInformationFull, OAuthClientMetadata
7+
from mcp.shared.auth import OAuthClientInformationFull, OAuthClientMetadata, OAuthToken
8+
9+
10+
class MockTokenStorage:
11+
"""Mock token storage for testing."""
12+
13+
def __init__(self):
14+
self._tokens: OAuthToken | None = None
15+
self._client_info: OAuthClientInformationFull | None = None
16+
17+
async def get_tokens(self) -> OAuthToken | None:
18+
return self._tokens
19+
20+
async def set_tokens(self, tokens: OAuthToken) -> None:
21+
self._tokens = tokens
22+
23+
async def get_client_info(self) -> OAuthClientInformationFull | None:
24+
return self._client_info
25+
26+
async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:
27+
self._client_info = client_info
928

1029

1130
@pytest.fixture

0 commit comments

Comments
 (0)