diff --git a/pyproject.toml b/pyproject.toml index 5dc6740..9e24e81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,7 @@ exclude_lines = [ 'pragma: no cover', 'raise NotImplementedError', 'if __name__ == .__main__.:', + '\.\.\.', ] ignore_errors = true omit = ['docs/*', 'tests/*'] diff --git a/tests/signing/tests.py b/tests/signing/tests.py index 72cd787..e2aa3b1 100644 --- a/tests/signing/tests.py +++ b/tests/signing/tests.py @@ -113,6 +113,7 @@ def test_sign_unsign_object(self): ["a", "list"], "a string \u2019", {"a": "dictionary"}, + "a" * 100, ] for obj in tests: with self.subTest(obj=obj): @@ -310,6 +311,10 @@ def test_works_with_non_ascii_keys(self): s.sign("foo"), ) + def test_unsupported_algorithm(self): + with self.assertRaises(InvalidAlgorithm): + signing.BytesSigner("predictable-key", algorithm="whatever") + class TestFernetSigner(SimpleTestCase): def test_fernet_signer(self): @@ -344,9 +349,10 @@ def test_bad_payload(self): # Break the signature signer.unsign(value[:-1] + b" ") - def test_unsupported(self): - value = b"hello" - signer = signing.FernetSigner("predictable-key") - with self.assertRaises(signing.BadSignature): - signer.unsign(value) + # Break everything + signer.unsign(b"hello") + + def test_unsupported_algorithm(self): + with self.assertRaises(InvalidAlgorithm): + signing.FernetSigner("predictable-key", algorithm="whatever")