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

Method test_unicode_result_nonraw

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

Source from the content-addressed store, hash-verified

141 self.skipTest('MAGIC_EXTENSION not supported in this version')
142
143 def test_unicode_result_nonraw(self):
144 m = magic.Magic(raw=False)
145 src = os.path.join(MagicTest.TESTDATA_DIR, 'pgpunicode')
146 result = m.from_file(src)
147 # NOTE: This check is added as otherwise some magic files don't identify the test case as a PGP key.
148 if 'PGP' in result:
149 assert r"PGP\011Secret Sub-key -" == result
150 else:
151 raise unittest.SkipTest("Magic file doesn't return expected type.")
152
153 def test_unicode_result_raw(self):
154 m = magic.Magic(raw=True)

Callers

nothing calls this directly

Calls 1

from_fileMethod · 0.95

Tested by

no test coverage detected