tests: ensure serialization restrictions are in effect

pull/564/head
David Wilson 6 years ago
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…
Cancel
Save