MCPcopy Create free account
hub / github.com/ahupp/python-magic / test_pathlike

Method test_pathlike

test/python_magic_test.py:222–228  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

220 m.from_buffer(f.read())
221
222 def test_pathlike(self):
223 if sys.version_info < (3, 6):
224 return
225 from pathlib import Path
226 path = Path(self.TESTDATA_DIR, "test.pdf")
227 m = magic.Magic(mime=True)
228 self.assertEqual('application/pdf', m.from_file(path))
229
230
231if __name__ == '__main__':

Callers

nothing calls this directly

Calls 1

from_fileMethod · 0.95

Tested by

no test coverage detected