Skip to content

Commit 68b7399

Browse files
committed
add test coverage for the str() case in unpem
1 parent adaf864 commit 68b7399

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/ecdsa/test_der.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
remove_octet_string,
2727
remove_sequence,
2828
encode_implicit,
29+
unpem,
30+
topem,
2931
)
3032

3133

@@ -629,3 +631,9 @@ def test_remove_implicit_rejects_truncated_length():
629631
UnexpectedDER, match="Length longer than the provided buffer"
630632
):
631633
remove_implicit(bad)
634+
635+
636+
def test_unpem_with_str():
637+
data = b"\xff\x00\x01"
638+
out = unpem(str(topem(data, "KEY"), "ASCII"))
639+
assert data == out

0 commit comments

Comments
 (0)