upstream.fix-mime-test.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. Subject: Adjust test suite for changes in file 5.39
  2. Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
  3. Date: 2020-11-26
  4. Bug-Debian: https://bugs.debian.org/975784
  5. Forwarded: no
  6. MIME-type for python was added/changed in FILE5_38-36-geb373e43
  7. Detection of trunucated files was added in FILE5_38-106-g0c7cd78b
  8. --- a/test/test.py
  9. +++ b/test/test.py
  10. @@ -34,9 +34,9 @@
  11. def test_from_buffer_str_and_bytes(self):
  12. m = magic.Magic(mime=True)
  13. s = '#!/usr/bin/env python\nprint("foo")'
  14. - self.assertEqual("text/x-python", m.from_buffer(s))
  15. + self.assertEqual("text/x-script.python", m.from_buffer(s))
  16. b = b'#!/usr/bin/env python\nprint("foo")'
  17. - self.assertEqual("text/x-python", m.from_buffer(b))
  18. + self.assertEqual("text/x-script.python", m.from_buffer(b))
  19. def test_open_file(self):
  20. @@ -50,7 +50,7 @@
  21. try:
  22. m = magic.Magic(mime=True)
  23. self.assert_values(m, {
  24. - 'magic._pyc_': 'application/octet-stream',
  25. + 'magic._pyc_': 'text/x-bytecode.python',
  26. 'test.pdf': 'application/pdf',
  27. 'test.gz': 'application/gzip',
  28. 'text.txt': 'text/plain',