def test_handle_spi_response_json_rpc(self):
    orig_request = test_utils.build_request(
        '/_ah/api/rpc', '{"method": "foo.bar", "apiVersion": "X"}')
    self.assertTrue(orig_request.is_rpc())
    orig_request.request_id = 'Z'
    spi_request = orig_request.copy()
    spi_response = dispatcher.ResponseTuple('200 OK', [('a', 'b')],
                                            '{"some": "response"}')

    response = self.server.handle_spi_response(orig_request, spi_request,
                                               spi_response, {},
                                               self.start_response)
    response = ''.join(response)  # Merge response iterator into single body.

    self.assertEqual(self.response_status, '200 OK')
    self.assertIn(('a', 'b'), self.response_headers)
    self.assertEqual({'id': 'Z', 'result': {'some': 'response'}},
                     json.loads(response))
Regenerates secret key.
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/endpoints/endpoints_server_test.py/DevAppserverEndpointsServerTest.test_handle_spi_response_json_rpc--crossover with--dataset/ETHPy150Open Azure/azure-sdk-for-python/azure-mgmt-logic/azure/mgmt/logic/operations/workflow_access_keys_operations.py/WorkflowAccessKeysOperations.regenerate_secret_key