Skip to content

Commit

Permalink
Add test for upgrade_channel_to_proxy_authenticated
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio Grätz committed Aug 15, 2023
1 parent 6888e39 commit c80cf60
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/flytekit/unit/clients/test_auth_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c80cf60

Please sign in to comment.