From c80cf6016856733de03a318146d8ef1893af9102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabio=20Gr=C3=A4tz?= Date: Fri, 11 Aug 2023 21:24:12 +0200 Subject: [PATCH] Add test for upgrade_channel_to_proxy_authenticated --- tests/flytekit/unit/clients/test_auth_helper.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/flytekit/unit/clients/test_auth_helper.py b/tests/flytekit/unit/clients/test_auth_helper.py index e89ea2b4f9..42e1dfb6a4 100644 --- a/tests/flytekit/unit/clients/test_auth_helper.py +++ b/tests/flytekit/unit/clients/test_auth_helper.py @@ -21,6 +21,7 @@ get_session, load_cert, upgrade_channel_to_authenticated, + upgrade_channel_to_proxy_authenticated, wrap_exceptions_channel, ) from flytekit.clients.grpc_utils.auth_interceptor import AuthUnaryInterceptor @@ -163,6 +164,19 @@ def test_upgrade_channel_to_auth(): assert isinstance(out_ch._interceptor, AuthUnaryInterceptor) # noqa +def test_upgrade_channel_to_proxy_auth(): + ch = MagicMock() + out_ch = upgrade_channel_to_proxy_authenticated( + PlatformConfig( + auth_mode="Pkce", + proxy_command=["echo", "foo-bar"], + ), + ch, + ) + assert isinstance(out_ch._interceptor, AuthUnaryInterceptor) + assert isinstance(out_ch._interceptor._authenticator, CommandAuthenticator) + + def test_load_cert(): cert_file = os.path.join(os.path.dirname(__file__), "testdata", "rootCACert.pem") f = load_cert(cert_file)