tests: ensure serialization restrictions are in effect
This commit is contained in:
parent
ffdf31edd7
commit
e517810e5a
|
@ -8,11 +8,23 @@ from mitogen.core import b
|
|||
import testlib
|
||||
|
||||
|
||||
class EvilObject(object):
|
||||
pass
|
||||
|
||||
|
||||
def roundtrip(v):
|
||||
msg = mitogen.core.Message.pickled(v)
|
||||
return mitogen.core.Message(data=msg.data).unpickle()
|
||||
|
||||
|
||||
class EvilObjectTest(testlib.TestCase):
|
||||
def test_deserialization_fails(self):
|
||||
msg = mitogen.core.Message.pickled(EvilObject())
|
||||
e = self.assertRaises(mitogen.core.StreamError,
|
||||
lambda: msg.unpickle()
|
||||
)
|
||||
|
||||
|
||||
class BlobTest(testlib.TestCase):
|
||||
klass = mitogen.core.Blob
|
||||
|
||||
|
|
Loading…
Reference in New Issue