8000 tests: use `inline_snapshot.Is` on parametrized test · modelcontextprotocol/python-sdk@a7106f4 · GitHub
[go: up one dir, main page]

Skip to content

Commit a7106f4

Browse files
committed
tests: use inline_snapshot.Is on parametrized test
1 parent 0bcecff commit a7106f4

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

tests/client/test_auth.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import httpx
1212
import pytest
13-
from inline_snapshot import snapshot
13+
from inline_snapshot import Is, snapshot
1414
from pydantic import AnyHttpUrl, AnyUrl
1515

1616
from mcp.client.auth import OAuthClientProvider
@@ -880,18 +880,18 @@ def test_build_metadata(
880880
revocation_options=RevocationOptions(enabled=True),
881881
)
882882

883-
assert metadata == snapshot(
884-
OAuthMetadata(
885-
issuer=AnyHttpUrl(issuer_url),
886-
authorization_endpoint=AnyHttpUrl(authorization_endpoint),
887-
token_endpoint=AnyHttpUrl(token_endpoint),
888-
registration_endpoint=AnyHttpUrl(registration_endpoint),
889-
scopes_supported=["read", "write", "admin"],
890-
grant_types_supported=["authorization_code", "refresh_token"],
891-
token_endpoint_auth_methods_supported=["client_secret_post"],
892-
service_documentation=AnyHttpUrl(service_documentation_url),
893-
revocation_endpoint=AnyHttpUrl(revocation_endpoint),
894-
revocation_endpoint_auth_methods_supported=["client_secret_post"],
895-
code_challenge_methods_supported=["S256"],
896-
)
883+
assert metadata.model_dump(exclude_defaults=True) == snapshot(
884+
{
885+
"issuer": Is(AnyHttpUrl(issuer_url)),
886+
"authorization_endpoint": Is(AnyHttpUrl(authorization_endpoint)),
887+
"token_endpoint": Is(AnyHttpUrl(token_endpoint)),
888+
"registration_endpoint": Is(AnyHttpUrl(registration_endpoint)),
889+
"scopes_supported": ["read", "write", "admin"],
890+
"grant_types_supported": ["authorization_code", "refresh_token"],
891+
"token_endpoint_auth_methods_supported": ["client_secret_post"],
892+
"service_documentation": Is(AnyHttpUrl(service_documentation_url)),
893+
"revocation_endpoint": Is(AnyHttpUrl(revocation_endpoint)),
894+
"revocation_endpoint_auth_methods_supported": ["client_secret_post"],
895+
"code_challenge_methods_supported": ["S256"],
896+
}
897897
)

0 commit comments

Comments
 (0)
0