예제 #1
0
 def setUp(self):
     super(PickleTests, self).setUp()
     self._pickler = pickle.Pickler()
     self._unpickler = pickle.Unpickler()
     self._dumps = self._pickler.dumps
     self._loads = self._unpickler.loads
예제 #2
0
 def loads(self, buf):
     f = io.BytesIO(buf)
     u = pickle.Unpickler(f)
     return u.load()
예제 #3
0
 def test_read_exception(self):
     f = ExceptionFileLike()
     u = pickle.Unpickler(f)
     self.assertRaises(RuntimeError, u.load)