We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f56e9fc commit 8d8e485Copy full SHA for 8d8e485
1 file changed
test/test.py
@@ -58,10 +58,14 @@ def test_from_file_str_and_bytes(self):
58
59
def test_from_buffer_str_and_bytes(self):
60
m = magic.Magic(mime=True)
61
- s = '#!/usr/bin/env python\nprint("foo")'
62
- self.assertEqual("text/x-script.python", m.from_buffer(s))
63
- b = b'#!/usr/bin/env python\nprint("foo")'
64
- self.assertEqual("text/x-script.python", m.from_buffer(b))
+
+ self.assertTrue(
+ m.from_buffer('#!/usr/bin/env python\nprint("foo")')
+ in ("text/x-python", "text/x-script.python"))
65
66
+ m.from_buffer(b'#!/usr/bin/env python\nprint("foo")')
67
68
69
70
def test_mime_types(self):
71
dest = os.path.join(MagicTest.TESTDATA_DIR,
0 commit comments