Skip to content

Commit

Permalink
tests/test_embeddedfiles.py: added test_4050().
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-smith-artifex-com committed Nov 19, 2024
1 parent 78bf986 commit 961552c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tests/test_embeddedfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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,
}

0 comments on commit 961552c

Please sign in to comment.