@@ -38,12 +38,12 @@ async def test_async_pydantic_model_json_body():
3838 # For this test, we'll use a simple mock by patching the _request method
3939
4040 class MockAsyncClient (TestAsyncFormBodyClient ):
41- async def _request (self , method , path , ** kwargs ):
41+ async def _request (self , request_info ):
4242 # Verify that the correct parameters are passed
43- assert method == "POST"
44- assert path == "/users"
45- assert kwargs . get ( ' json' ) == {"name" : "Test User" , "email" : "test@example.com" }
46- assert kwargs . get ( ' data' ) is None # Should be None for JSON requests
43+ assert request_info . method == "POST"
44+ assert request_info . path == "/users"
45+ assert request_info . json == {"name" : "Test User" , "email" : "test@example.com" }
46+ assert request_info . data is None # Should be None for JSON requests
4747
4848 # Return mock response
4949 return {"id" : "123" , "name" : "Test User" , "email" : "test@example.com" }
@@ -60,12 +60,12 @@ async def test_async_pydantic_model_form_body():
6060 """Test that async client correctly handles Pydantic models as form data"""
6161
6262 class MockAsyncClient (TestAsyncFormBodyClient ):
63- async def _request (self , method , path , ** kwargs ):
63+ async def _request (self , request_info ):
6464 # Verify that the correct parameters are passed
65- assert method == "POST"
66- assert path == "/users"
67- assert kwargs . get ( ' data' ) == {"name" : "Test User" , "email" : "test@example.com" }
68- assert kwargs . get ( ' json' ) is None # Should be None for form requests
65+ assert request_info . method == "POST"
66+ assert request_info . path == "/users"
67+ assert request_info . data == {"name" : "Test User" , "email" : "test@example.com" }
68+ assert request_info . json is None # Should be None for form requests
6969
7070 # Return mock response
7171 return {"id" : "123" , "name" : "Test User" , "email" : "test@example.com" }
@@ -82,11 +82,11 @@ async def test_async_custom_headers():
8282 """Test that async client correctly handles custom headers"""
8383
8484 class MockAsyncClient (TestAsyncFormBodyClient ):
85- async def _request (self , method , path , ** kwargs ):
85+ async def _request (self , request_info ):
8686 # Verify that the correct parameters are passed
87- assert method == "POST"
88- assert path == "/users/custom"
89- assert kwargs . get ( ' headers' ) == {"X-Custom-Header" : "custom-value" , "Authorization" : "Bearer token123" }
87+ assert request_info . method == "POST"
88+ assert request_info . path == "/users/custom"
89+ assert request_info . headers == {"X-Custom-Header" : "custom-value" , "Authorization" : "Bearer token123" }
9090
9191 # Return mock response
9292 return {"id" : "123" , "name" : "Test User" , "email" : "test@example.com" }
0 commit comments