示例#1
0
    def setUp(self, mock_setup_structures):
        super(NamedPipeTestCase, self).setUp()

        self._mock_input_queue = mock.Mock()
        self._mock_output_queue = mock.Mock()
        self._mock_client_connected = mock.Mock()

        self._ioutils = mock.Mock()

        threading_patcher = mock.patch.object(namedpipe, 'threading')
        threading_patcher.start()
        self.addCleanup(threading_patcher.stop)

        self._handler = namedpipe.NamedPipeHandler(mock.sentinel.pipe_name,
                                                   self._mock_input_queue,
                                                   self._mock_output_queue,
                                                   self._mock_client_connected,
                                                   self._FAKE_LOG_PATH)
        self._handler._ioutils = self._ioutils
示例#2
0
def get_named_pipe_handler(*args, **kwargs):
    return namedpipe.NamedPipeHandler(*args, **kwargs)