Skip to content

Commit d547d92

Browse files
committed
fix test formatting
1 parent 82d8e53 commit d547d92

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/ecdsa/test_der.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,22 +601,31 @@ def test_oids(ids):
601601
assert rest == b""
602602
assert decoded_oid == ids
603603

604+
604605
def test_remove_octet_string_rejects_truncated_length():
605606
# OCTET STRING: declared length 4096, but only 3 bytes present
606607
bad = b"\x04\x82\x10\x00" + b"ABC"
607-
with pytest.raises(UnexpectedDER, match="Length longer than the provided buffer"):
608+
with pytest.raises(
609+
UnexpectedDER, match="Length longer than the provided buffer"
610+
):
608611
remove_octet_string(bad)
609612

613+
610614
def test_remove_constructed_rejects_truncated_length():
611615
# Constructed tag: 0xA0 (context-specific constructed, tag=0)
612616
# declared length 4096, but only 3 bytes present
613617
bad = b"\xA0\x82\x10\x00" + b"ABC"
614-
with pytest.raises(UnexpectedDER, match="Length longer than the provided buffer"):
618+
with pytest.raises(
619+
UnexpectedDER, match="Length longer than the provided buffer"
620+
):
615621
remove_constructed(bad)
616622

623+
617624
def test_remove_implicit_rejects_truncated_length():
618625
# IMPLICIT primitive context-specific tag 0: 0x80
619626
# declared length 4096, but only 3 bytes present
620627
bad = b"\x80\x82\x10\x00" + b"ABC"
621-
with pytest.raises(UnexpectedDER, match="Length longer than the provided buffer"):
628+
with pytest.raises(
629+
UnexpectedDER, match="Length longer than the provided buffer"
630+
):
622631
remove_implicit(bad)

0 commit comments

Comments
 (0)