def assert_dispatch_to_spi(self, request, config, spi_path,
                             expected_spi_body_json=None):
    self.prepare_dispatch(config)

    spi_headers = [('Content-Type', 'application/json')]
    spi_body_json = expected_spi_body_json or {}
    spi_response = dispatcher.ResponseTuple('200 OK', [], 'Test')
    self.mock_dispatcher.add_request(
        'POST', spi_path, spi_headers, JsonMatches(spi_body_json),
        request.source_ip).AndReturn(spi_response)

    self.mox.StubOutWithMock(self.server, 'handle_spi_response')
    self.server.handle_spi_response(
        mox.IsA(api_request.ApiRequest), mox.IsA(api_request.ApiRequest),
        spi_response, mox.IsA(dict), self.start_response).AndReturn('Test')

    # Run the test.
    self.mox.ReplayAll()
    response = self.server.dispatch(request, self.start_response)
    self.mox.VerifyAll()

    self.assertEqual('Test', response)
Test PermissionResolver._IsAllowedToPropose().
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/endpoints/endpoints_server_test.py/DevAppserverEndpointsServerTest.assert_dispatch_to_spi--crossover with--dataset/ETHPy150Open google/simian/src/tests/simian/mac/common/auth_test.py/AuthModuleTest.testIsAllowedToPropose