0.4.27-16-g545a2a5.fix-test-suite-with-file-5-45.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. Subject: Fix test suite with file 5.45
  2. Origin: upstream, commit 0.4.27-16-g545a2a5 <https://github.com/ahupp/python-magic/commit/0.4.27-16-g545a2a5>
  3. Author: Dominique Leuenberger <dimstar@opensuse.org>
  4. Date: Wed Aug 2 11:29:47 2023 +0200
  5. Forwarded: not-needed
  6. [ 12s] test/python_magic_test.py:53: in assert_values
  7. [ 12s] self.assertIn(value, expected_value)
  8. [ 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')
  9. --- a/test/libmagic_test.py
  10. +++ b/test/libmagic_test.py
  11. @@ -15,7 +15,7 @@
  12. filename = os.path.join(TESTDATA_DIR, 'test.pdf')
  13. expected_mime_type = 'application/pdf'
  14. expected_encoding = 'us-ascii'
  15. - expected_name = ('PDF document, version 1.2', 'PDF document, version 1.2, 2 pages')
  16. + expected_name = ('PDF document, version 1.2', 'PDF document, version 1.2, 2 pages', 'PDF document, version 1.2, 2 page(s)')
  17. def assert_result(self, result):
  18. self.assertEqual(result.mime_type, self.expected_mime_type)
  19. --- a/test/python_magic_test.py
  20. +++ b/test/python_magic_test.py
  21. @@ -108,7 +108,8 @@
  22. self.assert_values(m, {
  23. 'magic._pyc_': 'python 2.4 byte-compiled',
  24. 'test.pdf': ('PDF document, version 1.2',
  25. - 'PDF document, version 1.2, 2 pages'),
  26. + 'PDF document, version 1.2, 2 pages',
  27. + 'PDF document, version 1.2, 2 page(s)'),
  28. 'test.gz':
  29. ('gzip compressed data, was "test", from Unix, last '
  30. 'modified: Sun Jun 29 01:32:52 2008',