Skip to content

Commit 961552c

Browse files
tests/test_embeddedfiles.py: added test_4050().
1 parent 78bf986 commit 961552c

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tests/test_embeddedfiles.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,23 @@ def test_embedded1():
2121
assert doc.embfile_info(0)["filename"] == "new-filename.txt"
2222
assert doc.embfile_get(0) == buffer
2323
doc.embfile_del(0)
24-
assert doc.embfile_count() == 0
24+
assert doc.embfile_count() == 0
25+
26+
def test_4050():
27+
with pymupdf.open() as document:
28+
document.embfile_add('test', b'foobar', desc='some text')
29+
d = document.embfile_info('test')
30+
print(f'{d=}')
31+
# Date is non-trivial to test for.
32+
del d['creationDate']
33+
del d['modDate']
34+
assert d == {
35+
'name': 'test',
36+
'collection': 0,
37+
'filename': 'test',
38+
'ufilename': 'test',
39+
'description': 'some text',
40+
'size': 6,
41+
'length': 6,
42+
}
43+

0 commit comments

Comments
 (0)