From 3ba8fd6109ac1f9314215f3373027d86c032dffc Mon Sep 17 00:00:00 2001 From: Shawn Zivontsis Date: Tue, 13 Aug 2024 01:25:31 -0400 Subject: [PATCH] Fix CI Errors (#878) * Fix new exception type for invalid key * Fix ruff now needs check command * Fix DeprecationWarning in test * Fix/ignore linter errors * Update codespell ignore list --- tests/oauth1/rfc5849/test_signatures.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git tests/oauth1/rfc5849/test_signatures.py tests/oauth1/rfc5849/test_signatures.py index 0dd2859a218e..2c4ce3df96c2 100644 --- tests/oauth1/rfc5849/test_signatures.py +++ tests/oauth1/rfc5849/test_signatures.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +from jwt import InvalidKeyError from oauthlib.oauth1.rfc5849.signature import ( base_string_uri, collect_parameters, normalize_parameters, sign_hmac_sha1_with_client, sign_hmac_sha256_with_client, @@ -765,12 +766,17 @@ MmgDHR2tt8KeYTSgfU+BAkBcaVF91EQ7VXhvyABNYjeYP7lU7orOgdWMa/zbLXSU # Signing needs a private key - for bad_value in [None, '', 'foobar']: + for bad_value in [None, '']: self.assertRaises(ValueError, sign_rsa_sha1_with_client, self.eg_signature_base_string, MockClient(rsa_key=bad_value)) + self.assertRaises(InvalidKeyError, + sign_rsa_sha1_with_client, + self.eg_signature_base_string, + MockClient(rsa_key='foobar')) + self.assertRaises(AttributeError, sign_rsa_sha1_with_client, self.eg_signature_base_string, -- 2.47.0