summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest/test.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test.py b/test/test.py
index a92972b..e29335f 100755
--- a/test/test.py
+++ b/test/test.py
@@ -32,6 +32,12 @@ class MagicTest(unittest.TestCase):
else:
self.assertTrue(False, "no match for " + repr(expected_value))
+ def test_from_file_str_and_bytes(self):
+ self.assertEqual('application/pdf',
+ magic.from_file("test/testdata/test.pdf", mime=True))
+ self.assertEqual('application/pdf',
+ magic.from_file(b"test/testdata/test.pdf", mime=True))
+
def test_from_buffer_str_and_bytes(self):
m = magic.Magic(mime=True)
s = '#!/usr/bin/env python\nprint("foo")'