python-python-magic/fix-test-tumbleweed.patch
Matej Cepl ab31f26d61 Accepting request 822791 from home:sebix:branches:devel:languages:python
- remove patches not necessary anymore:
 - magic-new-mime.patch
 - magic-pep8.patch
 - magic-tests.patch
 - magic-new-file.patch
- add patch fix-test.patch and fix-test-tumbleweed.patch to adapt the `file` test outputs to OpenSUSE.
- update to version 0.4.18:
 - Make bindings for magic_[set|get]param optional, and throw NotImplementedError
   if they are used but not supported. Only call setparam() in the constructor if
   it's supported. This prevents breakage on CentOS7 which uses an old version of
   libmagic.
- update to version 0.4.16 and 0.4.17 (changelog is combined upstream):
 - add MAGIC_MIME_TYPE constant, use that in preference to MAGIC_MIME internally.
   This sets up for a breaking change in a future major version bump where
   MAGIC_MIME will change to mathch magic.h.
 - add magic.version() function to return library version
 - add setparam/getparam to control internal behavior
 - increase internal limits with setparam to prevent spurious error on some jpeg files
 - various setup.py improvements to declare modern python support
 - support MSYS2 magic dlls
 - fix warning about using 'is' on an int in python 3.8
 - include tests in source distribution
 - many test improvements:
  - tox runner support
  - remove deprecated test_suite field from setup.py
  - docker tests that cover all LTS ubuntu versions
  - add test for snapp file identification
 - doc improvements
  - document dependency install process for debian
  - various typos

OBS-URL: https://build.opensuse.org/request/show/822791
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-magic?expand=0&rev=13
2020-07-29 12:49:19 +00:00

35 lines
1.7 KiB
Diff

--- python-magic-0.4.18/test/test.py 2020-05-06 04:25:46.000000000 +0200
+++ python-magic-0.4.18/test/test.py 2020-07-25 19:51:08.263172240 +0200
@@ -59,9 +59,9 @@
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 @@
try:
m = magic.Magic(mime=True)
self.assert_values(m, {
- 'magic._pyc_': 'application/octet-stream',
+ 'magic._pyc_': '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 @@
': 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'),