From e7bc919afc458d4aee18fe8c6aabfc8a94caac3933e84a285441acdf9b9ebd60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Wed, 2 Aug 2023 11:07:38 +0000 Subject: [PATCH] Accepting request 1101924 from home:dimstar:Factory - Add magic-file-5.45.patch: fix test suite with file 5.45 (gh#ahupp/python-magic#290). OBS-URL: https://build.opensuse.org/request/show/1101924 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-magic?expand=0&rev=29 --- magic-file-5.45.patch | 27 +++++++++++++++++++++++++++ python-python-magic.changes | 6 ++++++ python-python-magic.spec | 1 + 3 files changed, 34 insertions(+) create mode 100644 magic-file-5.45.patch diff --git a/magic-file-5.45.patch b/magic-file-5.45.patch new file mode 100644 index 0000000..936697f --- /dev/null +++ b/magic-file-5.45.patch @@ -0,0 +1,27 @@ +Index: python-magic-0.4.27/test/python_magic_test.py +=================================================================== +--- python-magic-0.4.27.orig/test/python_magic_test.py ++++ python-magic-0.4.27/test/python_magic_test.py +@@ -108,7 +108,8 @@ class MagicTest(unittest.TestCase): + 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', +Index: python-magic-0.4.27/test/libmagic_test.py +=================================================================== +--- python-magic-0.4.27.orig/test/libmagic_test.py ++++ python-magic-0.4.27/test/libmagic_test.py +@@ -15,7 +15,7 @@ class MagicTestCase(unittest.TestCase): + 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) diff --git a/python-python-magic.changes b/python-python-magic.changes index 6828b26..ed96f79 100644 --- a/python-python-magic.changes +++ b/python-python-magic.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 2 09:28:03 UTC 2023 - Dominique Leuenberger + +- Add magic-file-5.45.patch: fix test suite with file 5.45 + (gh#ahupp/python-magic#290). + ------------------------------------------------------------------- Fri Apr 21 12:32:16 UTC 2023 - Dirk Müller diff --git a/python-python-magic.spec b/python-python-magic.spec index e8d2c99..22d8c2f 100644 --- a/python-python-magic.spec +++ b/python-python-magic.spec @@ -28,6 +28,7 @@ Group: Development/Languages/Python URL: https://github.com/ahupp/python-magic Source: https://github.com/ahupp/python-magic/archive/%{version}.tar.gz Patch0: https://github.com/ahupp/python-magic/commit/4ffcd591.patch +Patch1: magic-file-5.45.patch BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module xml}