33import pytest
44from dotenv import load_dotenv
55
6- from resolver_athena_client .client .athena_options import AthenaOptions
7- from resolver_athena_client .client .channel import (
8- CredentialHelper ,
9- create_channel_with_credentials ,
10- )
6+ from resolver_athena_client .client .channel import CredentialHelper
117from resolver_athena_client .client .exceptions import OAuthError
128
139
14- @pytest .mark .asyncio
1510@pytest .mark .functional
16- async def test_invalid_secret (athena_options : AthenaOptions ) -> None :
11+ def test_invalid_secret () -> None :
1712 """Test that an invalid OAuth client secret is rejected."""
1813 _ = load_dotenv ()
1914 invalid_client_secret = "this_is_not_a_valid_secret"
@@ -31,15 +26,12 @@ async def test_invalid_secret(athena_options: AthenaOptions) -> None:
3126 )
3227
3328 with pytest .raises (OAuthError ):
34- _ = await create_channel_with_credentials (
35- athena_options .host , credential_helper = credential_helper
36- )
29+ credential_helper .get_token ()
3730
3831
39- @pytest .mark .asyncio
4032@pytest .mark .functional
41- async def test_invalid_clientid (athena_options : AthenaOptions ) -> None :
42- """Test that an invalid OAuth client secret is rejected."""
33+ def test_invalid_clientid () -> None :
34+ """Test that an invalid OAuth client ID is rejected."""
4335 _ = load_dotenv ()
4436 client_secret = os .environ ["OAUTH_CLIENT_SECRET" ]
4537 client_id = "this_is_not_a_valid_client_id"
@@ -56,14 +48,11 @@ async def test_invalid_clientid(athena_options: AthenaOptions) -> None:
5648 )
5749
5850 with pytest .raises (OAuthError ):
59- _ = await create_channel_with_credentials (
60- athena_options .host , credential_helper = credential_helper
61- )
51+ credential_helper .get_token ()
6252
6353
64- @pytest .mark .asyncio
6554@pytest .mark .functional
66- async def test_invalid_audience (athena_options : AthenaOptions ) -> None :
55+ def test_invalid_audience () -> None :
6756 """Test that an invalid OAuth audience is rejected."""
6857 _ = load_dotenv ()
6958 client_secret = os .environ ["OAUTH_CLIENT_SECRET" ]
@@ -81,6 +70,4 @@ async def test_invalid_audience(athena_options: AthenaOptions) -> None:
8170 )
8271
8372 with pytest .raises (OAuthError ):
84- _ = await create_channel_with_credentials (
85- athena_options .host , credential_helper = credential_helper
86- )
73+ credential_helper .get_token ()
0 commit comments