ahupp / python-magic

A python wrapper for libmagic
Other
2.6k stars 280 forks source link

Upcoming test suite breakage to to changes in file #283

Closed cbiedl closed 1 year ago

cbiedl commented 1 year ago

Heads-up: This commit in file:

Author: Christos Zoulas <christos@zoulas.com>
Date:   Wed Dec 21 15:55:52 2022 +0000

    Add more extensions and remove truncated stuff from size (Joerg Jenderek)

introduced more extensions for gz-compressed files, breaking the test suite. Consider relaxing the test as for example:

--- a/test/python_magic_test.py
+++ b/test/python_magic_test.py
@@ -134,7 +134,7 @@
             self.assert_values(m, {
                 # some versions return '' for the extensions of a gz file,
                 # including w/ the command line.  Who knows...
-                'test.gz': ('gz/tgz/tpz/zabw/svgz', '', '???'),
+                'test.gz': ('gz/tgz/tpz/zabw/svgz/adz/kmy/xcfgz', 'gz/tgz/tpz/zabw/svgz', '', '???'),
                 'name_use.jpg': 'jpeg/jpg/jpe/jfif',
             })
         except NotImplementedError:

Kind regards,

david-geiger commented 1 year ago

Hi,

Same build issue here on Mageia Linux:

test/python_magic_test.py:53: in assert_values self.assertIn(value, expected_value) E AssertionError: 'gz/tgz/tpz/zabw/svgz/adz/kmy/xcfgz' not found in ('gz/tgz/tpz/zabw/svgz', '', '???')

david-geiger commented 1 year ago

I confim that the proposed patch work and fixes tests.

cbiedl commented 1 year ago

Fixed in commit 4ffcd59