summaryrefslogtreecommitdiff
path: root/dev-python/python-magic/files/python-magic-0.4.15-fix-jpeg-test.patch
diff options
context:
space:
mode:
authorLouis Sautier <sbraz@gentoo.org>2018-08-18 03:04:13 +0200
committerPatrice Clement <monsieurp@gentoo.org>2018-08-23 10:17:07 +0200
commit7de54d8bb0adfbc64a5d291416e58884d3096fb8 (patch)
treeea2d33f42a3d01ba75c567e713925be378de75ea /dev-python/python-magic/files/python-magic-0.4.15-fix-jpeg-test.patch
parenta6868ac7d5a6a3bac11adfc9bc6850c0c1321879 (diff)
downloadgentoo-7de54d8bb0adfbc64a5d291416e58884d3096fb8.tar.gz
gentoo-7de54d8bb0adfbc64a5d291416e58884d3096fb8.tar.bz2
gentoo-7de54d8bb0adfbc64a5d291416e58884d3096fb8.zip
dev-python/python-magic: add Python 3.7, PyPy{,3}, fix tests.
* Tests didn't work with recent versions of file. Provide patches that have been merged upstream. * Fix dependencies, DEPEND=${DEPEND} was a typo. * EAPI=7. Package-Manager: Portage-2.3.45, Repoman-2.3.10 Closes: https://github.com/gentoo/gentoo/pull/9607
Diffstat (limited to 'dev-python/python-magic/files/python-magic-0.4.15-fix-jpeg-test.patch')
-rw-r--r--dev-python/python-magic/files/python-magic-0.4.15-fix-jpeg-test.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/dev-python/python-magic/files/python-magic-0.4.15-fix-jpeg-test.patch b/dev-python/python-magic/files/python-magic-0.4.15-fix-jpeg-test.patch
new file mode 100644
index 000000000000..9efb34b6672e
--- /dev/null
+++ b/dev-python/python-magic/files/python-magic-0.4.15-fix-jpeg-test.patch
@@ -0,0 +1,49 @@
+commit 4bda684f8b461cc1f69593799efcf6afe8397756
+Author: Adam Hupp <adam@hupp.org>
+Date: Sat Dec 9 09:09:00 2017 -0800
+
+ fix test for xenial since travis started enabling it
+
+diff --git a/test/test.py b/test/test.py
+index addccc6..c6e2d9c 100755
+--- a/test/test.py
++++ b/test/test.py
+@@ -17,7 +17,7 @@ class MagicTest(unittest.TestCase):
+ except TypeError:
+ filename = os.path.join(self.TESTDATA_DIR.encode('utf-8'), filename)
+
+-
++
+ if type(expected_value) is not tuple:
+ expected_value = (expected_value,)
+
+@@ -37,7 +37,7 @@ class MagicTest(unittest.TestCase):
+ self.assertEqual("text/x-python", m.from_buffer(s))
+ b = b'#!/usr/bin/env python\nprint("foo")'
+ self.assertEqual("text/x-python", m.from_buffer(b))
+-
++
+ 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)
+@@ -92,9 +92,9 @@ class MagicTest(unittest.TestCase):
+
+ m = magic.Magic(mime=True)
+ self.assertEqual(m.from_file(filename), 'image/jpeg')
+-
++
+ m = magic.Magic(mime=True, keep_going=True)
+- self.assertEqual(m.from_file(filename), 'image/jpeg')
++ self.assertEqual(m.from_file(filename), 'image/jpeg\\012- application/octet-stream')
+
+
+ def test_rethrow(self):
+@@ -103,7 +103,7 @@ class MagicTest(unittest.TestCase):
+ def t(x,y):
+ raise magic.MagicException("passthrough")
+ magic.magic_buffer = t
+-
++
+ self.assertRaises(magic.MagicException, magic.from_buffer, "hello", True)
+ finally:
+ magic.magic_buffer = old