Skip to content

Commit 8d8e485

Browse files
committed
support changed mime types in test
1 parent f56e9fc commit 8d8e485

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

test/test.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,14 @@ def test_from_file_str_and_bytes(self):
5858

5959
def test_from_buffer_str_and_bytes(self):
6060
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))
61+
62+
self.assertTrue(
63+
m.from_buffer('#!/usr/bin/env python\nprint("foo")')
64+
in ("text/x-python", "text/x-script.python"))
65+
self.assertTrue(
66+
m.from_buffer(b'#!/usr/bin/env python\nprint("foo")')
67+
in ("text/x-python", "text/x-script.python"))
68+
6569

6670
def test_mime_types(self):
6771
dest = os.path.join(MagicTest.TESTDATA_DIR,

0 commit comments

Comments
 (0)