mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-04-30 10:01:37 +02:00
Build with gpep517, temporarily skip tests affected by a regression in libmagic's `magic_buffer` function in 5.47. Upstream issue: https://github.com/houseabsolute/File-LibMagic/issues/31 ``` ____________________ MagicTestCase.test_detect_from_content ____________________ self = <test.libmagic_test.MagicTestCase testMethod=test_detect_from_content> def test_detect_from_content(self): # differ from upstream by opening file in binary mode, # this avoids hitting a bug in python3+libfile bindings # see https://github.com/ahupp/python-magic/issues/152 # for a similar issue with open(self.filename, 'rb') as fobj: result = magic.detect_from_content(fobj.read(4096)) > self.assert_result(result) test/libmagic_test.py:46: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ test/libmagic_test.py:23: in assert_result self.assertIn(result.name, self.expected_name) E AssertionError: 'PDF document, version %.%, 2 page(s)' not found in ('PDF document, version 1.2', 'PDF document, version 1.2,2 pages', 'PDF document, version 1.2, 2 page(s)') ``` Update the apache parquet mimetype in the `MagicTest.test_mime_types` test to fix it with file 5.47. ``` __________________________ MagicTest.test_mime_types ___________________________ self = <test.python_magic_test.MagicTest testMethod=test_mime_types> def test_mime_types(self): dest = os.path.join(MagicTest.TESTDATA_DIR, b'\xce\xbb'.decode('utf-8')) shutil.copyfile(os.path.join(MagicTest.TESTDATA_DIR, 'lambda'), dest) try: m = magic.Magic(mime=True) > self.assert_values(m, { 'magic._pyc_': ('application/octet-stream', 'text/x-bytecode.python', 'application/x-bytecode.python'), 'test.pdf': 'application/pdf', 'test.gz': ('application/gzip', 'application/x-gzip'), 'test.snappy.parquet': 'application/octet-stream', 'text.txt': 'text/plain', b'\xce\xbb'.decode('utf-8'): 'text/plain', b'\xce\xbb': 'text/plain', }) test/python_magic_test.py:92: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ test/python_magic_test.py:53: in assert_values self.assertIn(value, expected_value) E AssertionError: 'application/vnd.apache.parquet' not found in ('application/octet-stream',) ```