Skip to content

Commit 82852be

Browse files
yannj-frKludex
andauthored
Update tests/server/auth/test_protected_resource.py
Co-authored-by: Marcelo Trylesinski <[email protected]>
1 parent 23fa8d4 commit 82852be

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

tests/server/auth/test_protected_resource.py

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,19 @@ async def protected_resource_test_client(protected_resource_app: Starlette):
3737
yield client
3838

3939

40-
class TestProtectedResourceMetadata:
41-
"""Test the Protected Resource Metadata model."""
42-
43-
@pytest.mark.anyio
44-
async def test_metadata_endpoint(self, protected_resource_test_client: httpx.AsyncClient):
45-
"""Test the OAuth 2.0 Protected Resource metadata endpoint."""
46-
47-
response = await protected_resource_test_client.get("/.well-known/oauth-protected-resource")
48-
metadata = response.json()
49-
assert metadata == snapshot(
50-
{
51-
"resource": "https://example.com/resource",
52-
"authorization_servers": ["https://auth.example.com/authorization"],
53-
"scopes_supported": ["read", "write"],
54-
"resource_name": "Example Resource",
55-
"resource_documentation": "https://docs.example.com/resource",
56-
"bearer_methods_supported": ["header"],
57-
}
58-
)
40+
@pytest.mark.anyio
41+
async def test_metadata_endpoint(self, test_client: httpx.AsyncClient):
42+
"""Test the OAuth 2.0 Protected Resource metadata endpoint."""
43+
44+
response = await protected_resource_test_client.get("/.well-known/oauth-protected-resource")
45+
metadata = response.json()
46+
assert metadata == snapshot(
47+
{
48+
"resource": "https://example.com/resource",
49+
"authorization_servers": ["https://auth.example.com/authorization"],
50+
"scopes_supported": ["read", "write"],
51+
"resource_name": "Example Resource",
52+
"resource_documentation": "https://docs.example.com/resource",
53+
"bearer_methods_supported": ["header"],
54+
}
55+
)

0 commit comments

Comments
 (0)