Esempio n. 1
0
class TestSameProcessInlineServer(TestServer):
    def _createQueueServer(self):
        #    Create the QueueServer programatically in our Process (not vi a a shell-out (yet))...
        self.qs = QueueServer(host=self.host,
                              port=self.port,
                              target=self.target,
                              marshaller=self.m,
                              hunt=True,
                              quiet=self.quiet,
                              maxClients=self.maxClients,
                              recvChunkSize=self.recvChunkSize,
                              readTimeout=self.readTimeout,
                              )
        #    ...and set it serving:
        self.qs.start().waitUntilRunning()
        #    not forgetting to save it's connection details.
        self.details = self.qs.details()
    def testDoubleClose(self):
        assert self.qs.close()
        assert self.qs.close()
    def testSimpleSend(self):
        #    Send some data and check that it's put onto the target queue.
        eResult = {"hello.world!":{123:456}}
        self.qw.put(eResult)
        received = self.target.get(True, timeout=self.TIMEOUT)
        assert received==eResult
Esempio n. 2
0
    md = RRQDebugger()
    a = md.finish_end("peerName", "relativeTime")
    print a
    md.start(filename="mock.file")
    a = md.setup_start("peerName123", "relativeTime123")
    print a
    #    Start a dummyQueueServer:
    q = Queue()
    m = MarshallerFactory.get(MarshallerFactory.DEFAULT)
    QS = QueueServer(port=22334, target=q, quiet=True, marshaller=m)
    QS.start()
    details = QS.details()
    md.start(server=details)
    a = md.setup_start("peerName123", "relativeTime123")
    print a
    data = q.get(block=True, timeout=10)
    QS.close()