Skip to content

Commit 046a250

Browse files
authored
fmt
1 parent ff7c694 commit 046a250

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/test_jwe.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -530,23 +530,23 @@ def test_kid_header_not_present_when_not_provided(self):
530530
def test_jwe_with_excessive_data(self, monkeypatch):
531531
enc = ALGORITHMS.A256CBC_HS512
532532
alg = ALGORITHMS.RSA_OAEP_256
533-
monkeypatch.setattr('jose.constants.JWE_SIZE_LIMIT', 1024)
534-
encrypted = jwe.encrypt(b"Text"*64*1024, PUBLIC_KEY_PEM, enc, alg)
533+
monkeypatch.setattr("jose.constants.JWE_SIZE_LIMIT", 1024)
534+
encrypted = jwe.encrypt(b"Text" * 64 * 1024, PUBLIC_KEY_PEM, enc, alg)
535535
header = json.loads(base64url_decode(encrypted.split(b".")[0]))
536536
with pytest.raises(JWEError) as excinfo:
537537
actual = jwe.decrypt(encrypted, PRIVATE_KEY_PEM)
538-
assert 'JWE string' in str(excinfo.value)
539-
assert 'bytes exceeds' in str(excinfo.value)
538+
assert "JWE string" in str(excinfo.value)
539+
assert "bytes exceeds" in str(excinfo.value)
540540

541541
@pytest.mark.skipif(AESKey is None, reason="No AES backend")
542542
def test_jwe_zip_with_excessive_data(self, monkeypatch):
543543
# Test that a fix for CVE-2024-33664 is in place.
544544
enc = ALGORITHMS.A256CBC_HS512
545545
alg = ALGORITHMS.RSA_OAEP_256
546-
monkeypatch.setattr('jose.constants.JWE_SIZE_LIMIT', 1024)
547-
encrypted = jwe.encrypt(b"Text"*64*1024, PUBLIC_KEY_PEM, enc, alg, zip=ZIPS.DEF)
546+
monkeypatch.setattr("jose.constants.JWE_SIZE_LIMIT", 1024)
547+
encrypted = jwe.encrypt(b"Text" * 64 * 1024, PUBLIC_KEY_PEM, enc, alg, zip=ZIPS.DEF)
548548
assert len(encrypted) < jose.constants.JWE_SIZE_LIMIT
549549
header = json.loads(base64url_decode(encrypted.split(b".")[0]))
550550
with pytest.raises(JWEError) as excinfo:
551551
actual = jwe.decrypt(encrypted, PRIVATE_KEY_PEM)
552-
assert 'Decompressed JWE string exceeds' in str(excinfo.value)
552+
assert "Decompressed JWE string exceeds" in str(excinfo.value)

0 commit comments

Comments
 (0)