@@ -221,7 +221,6 @@ def auth_app(mock_oauth_provider):
221
221
def protected_resource_app (auth_app ):
222
222
"""Fixture to create protected resource routes for testing."""
223
223
224
- print (auth_app .router .routes )
225
224
# Create the protected resource routes
226
225
protected_resource_routes = create_protected_resource_routes (
227
226
resource_url = AnyHttpUrl ("https://example.com/resource" ),
@@ -355,11 +354,8 @@ class TestAuthEndpoints:
355
354
@pytest .mark .anyio
356
355
async def test_metadata_endpoint (self , test_client : httpx .AsyncClient ):
357
356
"""Test the OAuth 2.0 metadata endpoint."""
358
- print ( "Sending request to metadata endpoint" )
357
+
359
358
response = await test_client .get ("/.well-known/oauth-authorization-server" )
360
- print (f"Got response: { response .status_code } " )
361
- if response .status_code != 200 :
362
- print (f"Response content: { response .content } " )
363
359
assert response .status_code == 200
364
360
365
361
metadata = response .json ()
@@ -407,9 +403,7 @@ async def test_token_invalid_auth_code(self, test_client, registered_client, pkc
407
403
"redirect_uri" : "https://client.example.com/callback" ,
408
404
},
409
405
)
410
- print (f"Status code: { response .status_code } " )
411
- print (f"Response body: { response .content } " )
412
- print (f"Response JSON: { response .json ()} " )
406
+
413
407
assert response .status_code == 400
414
408
error_response = response .json ()
415
409
assert error_response ["error" ] == "invalid_grant"
@@ -1229,15 +1223,10 @@ class TestProtectedResourceMetadata:
1229
1223
@pytest .mark .anyio
1230
1224
async def test_metadata_endpoint (self , protected_resource_app : Starlette , test_client : httpx .AsyncClient ):
1231
1225
"""Test the OAuth 2.0 Protected Resource metadata endpoint."""
1232
- print ( "Sending request to protected resource metadata endpoint" )
1226
+
1233
1227
response = await test_client .get ("/.well-known/oauth-protected-resource" )
1234
- print (f"Got response: { response .status_code } " )
1235
- if response .status_code != 200 :
1236
- print (f"Response content: { response .content } " )
1237
1228
assert response .status_code == 200
1238
-
1239
1229
metadata = response .json ()
1240
- print (f"Protected Resource Metadata: { metadata } " )
1241
1230
assert metadata ["resource" ] == "https://example.com/resource"
1242
1231
assert metadata ["authorization_servers" ] == ["https://auth.example.com/authorization" ]
1243
1232
assert metadata ["scopes_supported" ] == ["read" , "write" ]
0 commit comments