Ejemplo n.º 1
0
 def setUp(self):
     self.loop = self.new_test_loop()
     self.addCleanup(self.loop.close)
     self.proactor = mock.Mock()
     self.loop._proactor = self.proactor
     self.protocol = test_utils.make_test_protocol(asyncio.Protocol)
     self.sock = mock.Mock(socket.socket)
Ejemplo n.º 2
0
 def setUp(self):
     self.loop = test_utils.TestLoop()
     self.sock = mock.Mock()
     self.proto = test_utils.make_test_protocol(aiozmq.ZmqProtocol)
     self.tr = _ZmqTransportImpl(self.loop, zmq.SUB, self.sock, self.proto)
     self.exc_handler = mock.Mock()
     self.loop.set_exception_handler(self.exc_handler)
 def setUp(self):
     self.loop = self.new_test_loop()
     self.addCleanup(self.loop.close)
     self.proactor = mock.Mock()
     self.loop._proactor = self.proactor
     self.protocol = test_utils.make_test_protocol(asyncio.Protocol)
     self.sock = mock.Mock(socket.socket)
Ejemplo n.º 4
0
 def setUp(self):
     self.loop = test_utils.TestLoop()
     self.sock = mock.Mock()
     self.proto = test_utils.make_test_protocol(aiozmq.ZmqProtocol)
     self.tr = _ZmqTransportImpl(self.loop, zmq.SUB, self.sock, self.proto)
     self.exc_handler = mock.Mock()
     self.loop.set_exception_handler(self.exc_handler)
Ejemplo n.º 5
0
 def setUp(self):
     self.loop = test_utils.TestLoop()
     self.sock = mock.Mock()
     self.sock.closed = False
     self.waiter = asyncio.Future(loop=self.loop)
     self.proto = test_utils.make_test_protocol(aiozmq.ZmqProtocol)
     self.tr = _ZmqLooplessTransportImpl(self.loop, zmq.SUB, self.sock,
                                         self.proto, self.waiter)
     self.exc_handler = mock.Mock()
     self.loop.set_exception_handler(self.exc_handler)
Ejemplo n.º 6
0
 def setUp(self):
     self.loop = test_utils.TestLoop()
     self.sock = mock.Mock()
     self.sock.closed = False
     self.waiter = asyncio.Future(loop=self.loop)
     self.proto = test_utils.make_test_protocol(aiozmq.ZmqProtocol)
     self.tr = _ZmqLooplessTransportImpl(self.loop,
                                         zmq.SUB, self.sock, self.proto,
                                         self.waiter)
     self.exc_handler = mock.Mock()
     self.loop.set_exception_handler(self.exc_handler)
Ejemplo n.º 7
0
    def setUp(self):
        self.loop = test_utils.TestLoop()
        self.protocol = test_utils.make_test_protocol(asyncio.BaseProtocol)
        self.pipe = unittest.mock.Mock(spec_set=io.RawIOBase)
        self.pipe.fileno.return_value = 5

        fcntl_patcher = unittest.mock.patch('fcntl.fcntl')
        fcntl_patcher.start()
        self.addCleanup(fcntl_patcher.stop)

        fstat_patcher = unittest.mock.patch('os.fstat')
        m_fstat = fstat_patcher.start()
        st = unittest.mock.Mock()
        st.st_mode = stat.S_IFSOCK
        m_fstat.return_value = st
        self.addCleanup(fstat_patcher.stop)
Ejemplo n.º 8
0
 def setUp(self):
     self.loop = test_utils.TestLoop()
     self.proactor = unittest.mock.Mock()
     self.loop._proactor = self.proactor
     self.protocol = test_utils.make_test_protocol(asyncio.Protocol)
     self.sock = unittest.mock.Mock(socket.socket)
Ejemplo n.º 9
0
 def setUp(self):
     self.loop = gpotato.GLibEventLoop(GLib.main_context_default())
     self.proactor = unittest.mock.Mock()
     self.loop._proactor = self.proactor
     self.protocol = test_utils.make_test_protocol(asyncio.Protocol)
     self.sock = unittest.mock.Mock(socket.socket)
Ejemplo n.º 10
0
 def setUp(self):
     self.loop = test_utils.TestLoop()
     self.proactor = mock.Mock()
     self.loop._proactor = self.proactor
     self.protocol = test_utils.make_test_protocol(asyncio.Protocol)
     self.sock = mock.Mock(socket.socket)