Browse Source

Fix test suite with file 5.45

Christoph Biedl 7 months ago
parent
commit
4981621a8f

+ 32 - 0
debian/patches/cherry-pick/1690968587.0.4.27-16-g545a2a5.fix-test-suite-with-file-5-45.patch

@@ -0,0 +1,32 @@
+Subject: Fix test suite with file 5.45
+Origin: 0.4.27-16-g545a2a5 <https://github.com/ahupp/python-magic/commit/0.4.27-16-g545a2a5>
+Upstream-Author: Dominique Leuenberger <dimstar@opensuse.org>
+Date: Wed Aug 2 11:29:47 2023 +0200
+
+    [   12s] test/python_magic_test.py:53: in assert_values
+    [   12s]     self.assertIn(value, expected_value)
+    [   12s] E   AssertionError: 'PDF document, version 1.2, 2 page(s)' not found in ('PDF document, version 1.2', 'PDF document, version 1.2, 2 pages')
+
+--- a/test/libmagic_test.py
++++ b/test/libmagic_test.py
+@@ -15,7 +15,7 @@
+     filename = os.path.join(TESTDATA_DIR, 'test.pdf')
+     expected_mime_type = 'application/pdf'
+     expected_encoding = 'us-ascii'
+-    expected_name = ('PDF document, version 1.2', 'PDF document, version 1.2, 2 pages')
++    expected_name = ('PDF document, version 1.2', 'PDF document, version 1.2, 2 pages', 'PDF document, version 1.2, 2 page(s)')
+ 
+     def assert_result(self, result):
+         self.assertEqual(result.mime_type, self.expected_mime_type)
+--- a/test/python_magic_test.py
++++ b/test/python_magic_test.py
+@@ -108,7 +108,8 @@
+             self.assert_values(m, {
+                 'magic._pyc_': 'python 2.4 byte-compiled',
+                 'test.pdf': ('PDF document, version 1.2',
+-                             'PDF document, version 1.2, 2 pages'),
++                             'PDF document, version 1.2, 2 pages',
++                             'PDF document, version 1.2, 2 page(s)'),
+                 'test.gz':
+                     ('gzip compressed data, was "test", from Unix, last '
+                      'modified: Sun Jun 29 01:32:52 2008',

+ 1 - 0
debian/patches/series

@@ -1,4 +1,5 @@
 # cherry-picked from upstream. Keep in chronological order
+cherry-pick/1690968587.0.4.27-16-g545a2a5.fix-test-suite-with-file-5-45.patch
 
 # patches that should go upstream
 2022-12-23.adjust-for-5.43.patch