|
|
e068e50 |
commit 2af6017be9d15b5f6b5a4a394b51a22f8d2c3c54
|
|
|
e068e50 |
Author: Felix Schwarz <felix.schwarz@oss.schwarz.eu>
|
|
|
e068e50 |
Date: Fri Jan 1 23:34:44 2021 +0100
|
|
|
e068e50 |
|
|
|
e068e50 |
test_metadata: add workaround for changed PDF date string in cairo 1.17.4
|
|
|
e068e50 |
|
|
|
e068e50 |
diff --git a/cairocffi/test_cairo.py b/cairocffi/test_cairo.py
|
|
|
e068e50 |
index 89e6bc4..a7c0abc 100644
|
|
|
e068e50 |
--- a/cairocffi/test_cairo.py
|
|
|
e068e50 |
+++ b/cairocffi/test_cairo.py
|
|
|
e068e50 |
@@ -255,7 +255,17 @@ def test_metadata():
|
|
|
e068e50 |
assert b'/Creator (creator)' in pdf_bytes
|
|
|
e068e50 |
assert b'/Author (author)' in pdf_bytes
|
|
|
e068e50 |
assert b'/Keywords (keywords)' in pdf_bytes
|
|
|
e068e50 |
- assert b"/CreationDate (20130721234600+01'00)" in pdf_bytes
|
|
|
e068e50 |
+ # According to PDF 32000-1:2008, section 7.9.4 ("Dates") PDF date strings
|
|
|
e068e50 |
+ # do not end with a apostrophe even though that format was described in
|
|
|
e068e50 |
+ # the "PDF reference, Sixth Edition".
|
|
|
e068e50 |
+ # See also: https://stackoverflow.com/q/41661477/138526
|
|
|
e068e50 |
+ # cairo 1.17.4 contains a commit which adds the apostrophe unconditionally:
|
|
|
e068e50 |
+ # https://gitlab.freedesktop.org/cairo/cairo/-/issues/392#note_742384
|
|
|
e068e50 |
+ if cairo_version() == 11704:
|
|
|
e068e50 |
+ expected_date_string = b"/CreationDate (20130721234600+01'00')"
|
|
|
e068e50 |
+ else:
|
|
|
e068e50 |
+ expected_date_string = b"/CreationDate (20130721234600+01'00)"
|
|
|
e068e50 |
+ assert expected_date_string in pdf_bytes
|
|
|
e068e50 |
assert b'/ModDate (20130721234600Z)' in pdf_bytes
|
|
|
e068e50 |
|
|
|
e068e50 |
|