diff --git a/tests/test_embeddedfiles.py b/tests/test_embeddedfiles.py index 95927cce2..f44a5acc9 100644 --- a/tests/test_embeddedfiles.py +++ b/tests/test_embeddedfiles.py @@ -21,4 +21,23 @@ def test_embedded1(): assert doc.embfile_info(0)["filename"] == "new-filename.txt" assert doc.embfile_get(0) == buffer doc.embfile_del(0) - assert doc.embfile_count() == 0 \ No newline at end of file + assert doc.embfile_count() == 0 + +def test_4050(): + with pymupdf.open() as document: + document.embfile_add('test', b'foobar', desc='some text') + d = document.embfile_info('test') + print(f'{d=}') + # Date is non-trivial to test for. + del d['creationDate'] + del d['modDate'] + assert d == { + 'name': 'test', + 'collection': 0, + 'filename': 'test', + 'ufilename': 'test', + 'description': 'some text', + 'size': 6, + 'length': 6, + } +