def setUp(self): self.sock = test_utils.mock_nonblocking_socket() self.proactor = mock.Mock() self.ssock, self.csock = mock.Mock(), mock.Mock() class EventLoop(BaseProactorEventLoop): def _socketpair(s): return (self.ssock, self.csock) self.loop = EventLoop(self.proactor) self.set_event_loop(self.loop)
def setUp(self): super().setUp() self.sock = test_utils.mock_nonblocking_socket() self.proactor = mock.Mock() self.ssock, self.csock = mock.Mock(), mock.Mock() class EventLoop(BaseProactorEventLoop): def _socketpair(s): return self.ssock, self.csock self.loop = EventLoop(self.proactor) self.set_event_loop(self.loop)
def setUp(self): super().setUp() self.sock = test_utils.mock_nonblocking_socket() self.proactor = mock.Mock() self.ssock, self.csock = mock.Mock(), mock.Mock() with mock.patch('asyncio.proactor_events.socket.socketpair', return_value=(self.ssock, self.csock)): self.loop = BaseProactorEventLoop(self.proactor) self.set_event_loop(self.loop)
def setUp(self): super().setUp() self.sock = test_utils.mock_nonblocking_socket() self.proactor = mock.Mock() self.ssock, self.csock = mock.Mock(), mock.Mock() with mock.patch('asyncio.proactor_events.socket.socketpair', return_value=(self.ssock, self.csock)): self.loop = BaseProactorEventLoop(self.proactor) self.set_event_loop(self.loop)