diff --git a/test/integ/test_key_pair_authentication.py b/test/integ/test_key_pair_authentication.py index 61c725efd..c7925fffa 100644 --- a/test/integ/test_key_pair_authentication.py +++ b/test/integ/test_key_pair_authentication.py @@ -248,8 +248,6 @@ def test_bad_private_key(db_parameters): ) bad_private_key_test_cases = [ - "abcd", - 1234, b"abcd", dsa_private_key_der, encrypted_rsa_private_key_der, diff --git a/test/unit/test_auth_keypair.py b/test/unit/test_auth_keypair.py index 411d09fde..2fbf45050 100644 --- a/test/unit/test_auth_keypair.py +++ b/test/unit/test_auth_keypair.py @@ -103,16 +103,17 @@ def test_auth_keypair_bad_type(): class Bad: pass - auth_instance = AuthByKeyPair(private_key=Bad()) - with raises(TypeError) as ex: - auth_instance.handle_timeout( - authenticator="SNOWFLAKE_JWT", - service_name=None, - account=account, - user=user, - password=None, - ) - assert "Bad" in str(ex) + for bad_private_key in ("abcd", 1234, Bad()): + auth_instance = AuthByKeyPair(private_key=bad_private_key) + with raises(TypeError) as ex: + auth_instance.handle_timeout( + authenticator="SNOWFLAKE_JWT", + service_name=None, + account=account, + user=user, + password=None, + ) + assert str(type(bad_private_key)) in str(ex) def _init_rest(application, post_requset):