MCPcopy Index your code
hub / github.com/ahupp/python-magic / test_rethrow

Method test_rethrow

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

Source from the content-addressed store, hash-verified

194 pass
195
196 def test_rethrow(self):
197 old = magic.magic_buffer
198 try:
199 def t(x, y):
200 raise magic.MagicException("passthrough")
201
202 magic.magic_buffer = t
203
204 with self.assertRaises(magic.MagicException):
205 magic.from_buffer("hello", True)
206 finally:
207 magic.magic_buffer = old
208
209 def test_getparam(self):
210 m = magic.Magic(mime=True)

Callers

nothing calls this directly

Calls 1

from_bufferMethod · 0.80

Tested by

no test coverage detected