Skip to content

Commit

Permalink
test deprecated name
Browse files Browse the repository at this point in the history
  • Loading branch information
francois committed Apr 21, 2024
1 parent ec6d4d1 commit 1f3853f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test_generic.py
Expand Up @@ -179,7 +179,14 @@ def test_read_string_from_stream_excape_digit2():
assert read_string_from_stream(stream) == "hello \x01\x02\x03\x04"


def test_name_object(caplog):
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
def test_deprecated_name_object():
b = BytesIO()
NameObject("wrong").write_to_stream(b)
assert b.getvalue() == b"wrong"


def test_name_object():
stream = BytesIO(b"x")
with pytest.raises(PdfReadError) as exc:
NameObject.read_from_stream(stream, None)
Expand Down

0 comments on commit 1f3853f

Please sign in to comment.