Exemplo n.º 1
0
 def testObjects(self):
     """Try moving objects across connection"""
     with open(self.filename, "wb") as outpipe:
         LLPC = LowLevelPipeConnection(None, outpipe)
         for obj in self.objs:
             LLPC._putobj(obj, 3)
     with open(self.filename, "rb") as inpipe:
         LLPC.inpipe = inpipe
         for obj in self.objs:
             gotten = LLPC._get()
             self.assertEqual(gotten, (3, obj))
     os.unlink(self.filename)
Exemplo n.º 2
0
 def testSendingExceptions(self):
     """Exceptions should also be sent down pipe well"""
     with open(self.filename, "wb") as outpipe:
         LLPC = LowLevelPipeConnection(None, outpipe)
         for exception in self.excts:
             LLPC._putobj(exception, 0)
     with open(self.filename, "rb") as inpipe:
         LLPC.inpipe = inpipe
         for exception in self.excts:
             incoming_exception = LLPC._get()
             assert isinstance(incoming_exception[1], exception.__class__)
     os.unlink(self.filename)