Ejemplo n.º 1
0
class test_ctrl_proc(TestCase):
    def setUp(self):
        ctx = zmq.Context()
        self.sock = ctx.socket(zmq.ROUTER)
        self.port = self.sock.bind_to_random_port('tcp://*')
        self.proc = ControlledProcess(self.port, 'proc')

    def tearDown(self):
        self.proc.terminate()

    def test_ctrl_quit(self):
        self.proc.start()
        time.sleep(1)
        self.sock.send_multipart([self.proc.id, 'quit'])
        time.sleep(1)
        assert not self.proc.is_alive()
Ejemplo n.º 2
0
class test_ctrl_proc(TestCase):
    def setUp(self):
        ctx = zmq.Context()
        self.sock = ctx.socket(zmq.ROUTER)
        self.port = self.sock.bind_to_random_port('tcp://*')
        self.proc = ControlledProcess(self.port, 'proc')

    def tearDown(self):
        self.proc.terminate()
        
    def test_ctrl_quit(self):    
        self.proc.start()
        time.sleep(1)
        self.sock.send_multipart([self.proc.id, 'quit'])
        time.sleep(1)
        assert not self.proc.is_alive()
Ejemplo n.º 3
0
 def setUp(self):
     ctx = zmq.Context()
     self.sock = ctx.socket(zmq.ROUTER)
     self.port = self.sock.bind_to_random_port('tcp://*')
     self.proc = ControlledProcess(self.port, 'proc')
Ejemplo n.º 4
0
 def setUp(self):
     ctx = zmq.Context()
     self.sock = ctx.socket(zmq.ROUTER)
     self.port = self.sock.bind_to_random_port('tcp://*')
     self.proc = ControlledProcess(self.port, 'proc')