summaryrefslogtreecommitdiff
path: root/test/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.py')
-rwxr-xr-xtest/test.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test.py b/test/test.py
index 0cd12fd..0c4621c 100755
--- a/test/test.py
+++ b/test/test.py
@@ -219,6 +219,14 @@ class MagicTest(unittest.TestCase):
with open(os.path.join(self.TESTDATA_DIR, 'name_use.jpg'), 'rb') as f:
m.from_buffer(f.read())
+ def test_pathlike(self):
+ if sys.version_info < (3, 6):
+ return
+ from pathlib import Path
+ path = Path(self.TESTDATA_DIR, "test.pdf")
+ m = magic.Magic(mime=True)
+ self.assertEqual('application/pdf', m.from_file(path))
+
if __name__ == '__main__':
unittest.main()