Skip to content

Commit 7987098

Browse files
author
Fabio Grätz
committed
Add test for upgrade_channel_to_proxy_authenticated
1 parent 4038eb3 commit 7987098

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/flytekit/unit/clients/test_auth_helper.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
get_session,
2222
load_cert,
2323
upgrade_channel_to_authenticated,
24+
upgrade_channel_to_proxy_authenticated,
2425
wrap_exceptions_channel,
2526
)
2627
from flytekit.clients.grpc_utils.auth_interceptor import AuthUnaryInterceptor
@@ -163,6 +164,19 @@ def test_upgrade_channel_to_auth():
163164
assert isinstance(out_ch._interceptor, AuthUnaryInterceptor) # noqa
164165

165166

167+
def test_upgrade_channel_to_proxy_auth():
168+
ch = MagicMock()
169+
out_ch = upgrade_channel_to_proxy_authenticated(
170+
PlatformConfig(
171+
auth_mode="Pkce",
172+
proxy_command=["echo", "foo-bar"],
173+
),
174+
ch,
175+
)
176+
assert isinstance(out_ch._interceptor, AuthUnaryInterceptor)
177+
assert isinstance(out_ch._interceptor._authenticator, CommandAuthenticator)
178+
179+
166180
def test_load_cert():
167181
cert_file = os.path.join(os.path.dirname(__file__), "testdata", "rootCACert.pem")
168182
f = load_cert(cert_file)

0 commit comments

Comments
 (0)