Skip to content

Commit

Permalink
Move cases which are now handled by type testing over to unit test
Browse files Browse the repository at this point in the history
malthe committed Aug 4, 2023
1 parent 8d5e6b8 commit 818c3e8
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 0 additions & 2 deletions test/integ/test_key_pair_authentication.py
Original file line number Diff line number Diff line change
@@ -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,
21 changes: 11 additions & 10 deletions test/unit/test_auth_keypair.py
Original file line number Diff line number Diff line change
@@ -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):

0 comments on commit 818c3e8

Please sign in to comment.