summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido A.J. Stevens <guido.stevens@cosent.nl>2018-01-25 09:19:10 +0000
committerGuido A.J. Stevens <guido.stevens@cosent.nl>2018-01-25 09:19:10 +0000
commit00cbfe57b08c3550d56979b58c993fe1c5911665 (patch)
treed87359187acd601d55f6d0613448f1acf138edb4
parent9cd831783921c6b2e3efe286fd6689cf788b0393 (diff)
downloadpython-magic-00cbfe57b08c3550d56979b58c993fe1c5911665.tar.gz
Bring "from_file()" under test
-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")'