def _setup_mock_channel(self, ch_type=BidirClientChannel, status_code=200, error_message="no problem", value="bidirmsg", op=None):
        ch = MagicMock(spec=ch_type())
        # set a return value for recv so we get an immediate response
        vals = [(value, {'status_code':status_code, 'error_message':error_message, 'op': op, 'conv-id':sentinel.conv_id}, sentinel.delivery_tag)]
        def _ret(*args, **kwargs):
            if len(vals):
                return vals.pop()
            raise ChannelClosedError()

        ch.recv.side_effect = _ret

        # need to set a send_name for now
        ch._send_name = NameTrio('', '')

        return ch
Sets up a mocked channel, ready for fake bidir communication.
dataset/ETHPy150Open ooici/pyon/pyon/net/test/test_endpoint.py/RecvMockMixin._setup_mock_channel