88
99
1010@pytest .fixture
11- def client_id ():
11+ def client_id () -> str | None :
1212 """Fixture to return a valid personal access token."""
1313 return os .getenv ("CLIENT_ID" )
1414
1515
1616@pytest .fixture
17- def client_secret ():
17+ def client_secret () -> str | None :
1818 """Fixture to return a valid personal access token."""
1919 return os .getenv ("CLIENT_SECRET" )
2020
2121
2222@pytest .fixture
23- def base_url ():
23+ def base_url () -> str | None :
2424 """Fixture to return the base URL."""
2525 return os .getenv ("BASE_URL" )
2626
2727
2828@pytest .fixture
29- def user_id (client_id , client_secret , base_url ) :
29+ def user_id (client_id : str , client_secret : str , base_url : str ) -> str | None :
3030 """Fixture to create a user and return their ID."""
3131 with zitadel .Zitadel (ClientCredentialsAuthenticator .builder (base_url , client_id , client_secret ).build ()) as client :
3232 try :
3333 response = client .users .add_human_user (
3434 body = zitadel .models .V2AddHumanUserRequest (
3535 username = uuid .uuid4 ().hex ,
36- profile = zitadel .models .V2SetHumanProfile (given_name = "John" , family_name = "Doe" ),
36+ profile = zitadel .models .V2SetHumanProfile (given_name = "John" , family_name = "Doe" ), # type: ignore[call-arg]
3737 email = zitadel .models .V2SetHumanEmail (email = f"johndoe{ uuid .uuid4 ().hex } @caos.ag" )
3838 )
3939 )
@@ -43,7 +43,7 @@ def user_id(client_id, client_secret, base_url):
4343 pytest .fail (f"Exception while creating user: { e } " )
4444
4545
46- def test_should_deactivate_and_reactivate_user_with_valid_token (user_id , client_id , client_secret , base_url ) :
46+ def test_should_deactivate_and_reactivate_user_with_valid_token (user_id : str , client_id : str , client_secret : str , base_url : str ) -> None :
4747 """Test to (de)activate the user with a valid token."""
4848 with zitadel .Zitadel (ClientCredentialsAuthenticator .builder (base_url , client_id , client_secret ).build ()) as client :
4949 try :
@@ -58,7 +58,7 @@ def test_should_deactivate_and_reactivate_user_with_valid_token(user_id, client_
5858 pytest .fail (f"Exception when calling deactivate_user or reactivate_user with valid token: { e } " )
5959
6060
61- def test_should_not_deactivate_or_reactivate_user_with_invalid_token (user_id , base_url ) :
61+ def test_should_not_deactivate_or_reactivate_user_with_invalid_token (user_id : str , base_url : str ) -> None :
6262 """Test to attempt (de)activating the user with an invalid token."""
6363 with zitadel .Zitadel (ClientCredentialsAuthenticator .builder (base_url , "id" , "secret" ).build ()) as client :
6464 try :
0 commit comments