def test_server_must_return_bytes(self):
    '\n        The server callback must return a bytestring, or a TypeError is thrown.\n        '

    def server_callback(*args):
        return self.sample_ocsp_data.decode('ascii')

    def client_callback(*args):
        pytest.fail('Should not be called')
    client = self._client_connection(callback=client_callback, data=None)
    server = self._server_connection(callback=server_callback, data=None)
    with pytest.raises(TypeError):
        handshake_in_memory(client, server)
The server callback must return a bytestring, or a TypeError is thrown.
def test_server_must_return_bytes(self):
    '\n        \n        '

    def server_callback(*args):
        return self.sample_ocsp_data.decode('ascii')

    def client_callback(*args):
        pytest.fail('Should not be called')
    client = self._client_connection(callback=client_callback, data=None)
    server = self._server_connection(callback=server_callback, data=None)
    with pytest.raises(TypeError):
        handshake_in_memory(client, server)