@@ -39,7 +39,7 @@ def test_wait_for_completion_calls_status_from_auth_response(
3939 auth = sync_auth_resource
4040 auth .status = Mock (return_value = AuthorizationResponse (status = "completed" )) # type: ignore
4141
42- auth_response = AuthorizationResponse (status = "pending" , authorization_id = "auth_id123" , scopes = scopes )
42+ auth_response = AuthorizationResponse (status = "pending" , id = "auth_id123" , scopes = scopes )
4343
4444 auth .wait_for_completion (auth_response )
4545
@@ -52,43 +52,39 @@ def test_wait_for_completion_calls_status_from_auth_response(
5252
5353def test_wait_for_completion_raises_value_error_for_empty_authorization_id (sync_auth_resource : AuthResource ) -> None :
5454 auth = sync_auth_resource
55- auth_response = AuthorizationResponse (status = "pending" , authorization_id = "" , scopes = ["scope1" ])
55+ auth_response = AuthorizationResponse (status = "pending" , id = "" , scopes = ["scope1" ])
5656
5757 with pytest .raises (ValueError , match = "Authorization ID is required" ):
5858 auth .wait_for_completion (auth_response )
5959
6060
6161@parametrize_scopes
62- def test_wait_for_completion_calls_status_with_auth_id (
63- sync_auth_resource : AuthResource , scopes : Optional [List [str ]], expected_scopes : Union [str , NotGiven ]
64- ) -> None :
62+ def test_wait_for_completion_calls_status_with_auth_id (sync_auth_resource : AuthResource ) -> None :
6563 auth = sync_auth_resource
6664 auth .status = Mock (return_value = AuthorizationResponse (status = "completed" )) # type: ignore
6765
68- auth .wait_for_completion ("auth_id456" , scopes )
66+ auth .wait_for_completion ("auth_id456" )
6967
7068 auth .status .assert_called_with (
71- authorization_id = "auth_id456" ,
72- scopes = expected_scopes ,
69+ id = "auth_id456" ,
7370 wait = 45 ,
7471 )
7572
7673
7774@pytest .mark .asyncio
7875@parametrize_scopes
7976async def test_async_wait_for_completion_calls_status_from_auth_response (
80- async_auth_resource : AsyncAuthResource , scopes : Optional [List [str ]], expected_scopes : Union [ str , NotGiven ]
77+ async_auth_resource : AsyncAuthResource , scopes : Optional [List [str ]]
8178) -> None :
8279 auth = async_auth_resource
8380 auth .status = AsyncMock (return_value = AuthorizationResponse (status = "completed" )) # type: ignore
8481
85- auth_response = AuthorizationResponse (status = "pending" , authorization_id = "auth_id789" , scopes = scopes )
82+ auth_response = AuthorizationResponse (status = "pending" , id = "auth_id789" , scopes = scopes )
8683
8784 await auth .wait_for_completion (auth_response )
8885
8986 auth .status .assert_called_with (
90- authorization_id = "auth_id789" ,
91- scopes = expected_scopes ,
87+ id = "auth_id789" ,
9288 wait = 45 ,
9389 )
9490
@@ -98,24 +94,21 @@ async def test_async_wait_for_completion_raises_value_error_for_empty_authorizat
9894 async_auth_resource : AsyncAuthResource ,
9995) -> None :
10096 auth = async_auth_resource
101- auth_response = AuthorizationResponse (status = "pending" , authorization_id = "" , scopes = ["scope1" ])
97+ auth_response = AuthorizationResponse (status = "pending" , id = "" , scopes = ["scope1" ])
10298
10399 with pytest .raises (ValueError , match = "Authorization ID is required" ):
104100 await auth .wait_for_completion (auth_response )
105101
106102
107103@pytest .mark .asyncio
108104@parametrize_scopes
109- async def test_async_wait_for_completion_calls_status_with_auth_id (
110- async_auth_resource : AsyncAuthResource , scopes : Optional [List [str ]], expected_scopes : Union [str , NotGiven ]
111- ) -> None :
105+ async def test_async_wait_for_completion_calls_status_with_auth_id (async_auth_resource : AsyncAuthResource ) -> None :
112106 auth = async_auth_resource
113107 auth .status = AsyncMock (return_value = AuthorizationResponse (status = "completed" )) # type: ignore
114108
115- await auth .wait_for_completion ("auth_id321" , scopes )
109+ await auth .wait_for_completion ("auth_id321" )
116110
117111 auth .status .assert_called_with (
118- authorization_id = "auth_id321" ,
119- scopes = expected_scopes ,
112+ id = "auth_id321" ,
120113 wait = 45 ,
121114 )
0 commit comments