diff options
author | Adam Hupp <adam@hupp.org> | 2020-09-15 00:22:42 -0700 |
---|---|---|
committer | Adam Hupp <adam@hupp.org> | 2020-09-15 00:23:52 -0700 |
commit | 8d8e4858af4e9b157f8e83cd8f1076c36ca6338d (patch) | |
tree | a79c7654d28cb5228c5e754626c4f2db13f1f848 /test/test.py | |
parent | f56e9fcfe05dbd51c82beccf72d802816aef77d8 (diff) | |
download | python-magic-8d8e4858af4e9b157f8e83cd8f1076c36ca6338d.tar.gz |
support changed mime types in test
Diffstat (limited to 'test/test.py')
-rwxr-xr-x | test/test.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/test.py b/test/test.py index c8c0e80..6f0f496 100755 --- a/test/test.py +++ b/test/test.py @@ -58,10 +58,14 @@ 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-script.python", m.from_buffer(s)) - b = b'#!/usr/bin/env python\nprint("foo")' - 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")) + self.assertTrue( + m.from_buffer(b'#!/usr/bin/env python\nprint("foo")') + in ("text/x-python", "text/x-script.python")) + def test_mime_types(self): dest = os.path.join(MagicTest.TESTDATA_DIR, |