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

Method test_detect_from_content

test/libmagic_test.py:39–46  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

37 self.assert_result(result)
38
39 def test_detect_from_content(self):
40 # differ from upstream by opening file in binary mode,
41 # this avoids hitting a bug in python3+libfile bindings
42 # see https://github.com/ahupp/python-magic/issues/152
43 # for a similar issue
44 with open(self.filename, 'rb') as fobj:
45 result = magic.detect_from_content(fobj.read(4096))
46 self.assert_result(result)
47
48
49if __name__ == '__main__':

Callers

nothing calls this directly

Calls 2

assert_resultMethod · 0.95
openFunction · 0.85

Tested by

no test coverage detected