summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Weiss <luca@z3ntu.xyz>2020-08-01 21:13:47 +0200
committerAdam Hupp <adam@hupp.org>2020-09-07 20:05:16 -0700
commitf56e9fcfe05dbd51c82beccf72d802816aef77d8 (patch)
treeba5c13c0b1f9ca39f65d77a0f04dccbae36c8edf
parent83864c858cc82d7e0f219c07fd7caa826dc47920 (diff)
downloadpython-magic-f56e9fcfe05dbd51c82beccf72d802816aef77d8.tar.gz
Fix tests with file 5.39
-rwxr-xr-xtest/test.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/test.py b/test/test.py
index dffefd6..c8c0e80 100755
--- a/test/test.py
+++ b/test/test.py
@@ -59,9 +59,9 @@ class MagicTest(unittest.TestCase):
def test_from_buffer_str_and_bytes(self):
m = magic.Magic(mime=True)
s = '#!/usr/bin/env python\nprint("foo")'
- self.assertEqual("text/x-python", m.from_buffer(s))
+ self.assertEqual("text/x-script.python", m.from_buffer(s))
b = b'#!/usr/bin/env python\nprint("foo")'
- self.assertEqual("text/x-python", m.from_buffer(b))
+ self.assertEqual("text/x-script.python", m.from_buffer(b))
def test_mime_types(self):
dest = os.path.join(MagicTest.TESTDATA_DIR,
@@ -70,7 +70,7 @@ class MagicTest(unittest.TestCase):
try:
m = magic.Magic(mime=True)
self.assert_values(m, {
- 'magic._pyc_': 'application/octet-stream',
+ 'magic._pyc_': ('application/octet-stream', 'text/x-bytecode.python'),
'test.pdf': 'application/pdf',
'test.gz': ('application/gzip', 'application/x-gzip'),
'test.snappy.parquet': 'application/octet-stream',
@@ -97,7 +97,9 @@ class MagicTest(unittest.TestCase):
': Sun Jun 29 01:32:52 2008, from Unix, original size 15',
'gzip compressed data, was "test", '
'last modified: Sun Jun 29 01:32:52 2008, '
- 'from Unix, original size modulo 2^32 15'
+ 'from Unix, original size modulo 2^32 15',
+ 'gzip compressed data, was "test", last modified'
+ ': Sun Jun 29 01:32:52 2008, from Unix, truncated'
),
'text.txt': 'ASCII text',
'test.snappy.parquet': ('Apache Parquet', 'Par archive data'),