App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Public Attributes | List of all members
google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest Class Reference
Inheritance diagram for google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest:
google.appengine.tools.devappserver2.endpoints.test_utils.TestsWithStartResponse

Public Member Functions

def setUp
 
def tearDown
 
def prepare_dispatch
 
def assert_dispatch_to_spi
 
def test_dispatch_invalid_path
 
def test_dispatch_invalid_enum
 
def test_dispatch_spi_error
 
def test_dispatch_rpc_error
 
def test_dispatch_json_rpc
 
def test_dispatch_rest
 
def test_explorer_redirect
 
def test_static_existing_file
 
def test_static_non_existing_file
 
def test_handle_non_json_spi_response
 
def test_handle_non_json_spi_response_cors
 
def check_cors
 
def test_handle_cors
 
def test_handle_cors_preflight
 
def test_handle_cors_preflight_invalid
 
def test_handle_cors_preflight_request_headers
 
def test_lily_uses_python_method_name
 
def test_handle_spi_response_json_rpc
 
def test_handle_spi_response_batch_json_rpc
 
def test_handle_spi_response_rest
 
def test_transform_rest_response
 
def test_transform_json_rpc_response_batch
 
def test_lookup_rpc_method_no_body
 
def test_lookup_rpc_method
 
def test_verify_response
 
def test_check_empty_response
 
def test_check_non_empty_response
 
- Public Member Functions inherited from google.appengine.tools.devappserver2.endpoints.test_utils.TestsWithStartResponse
def setUp
 
def assert_http_match
 

Public Attributes

 mox
 
 config_manager
 
 mock_dispatcher
 
 server
 
- Public Attributes inherited from google.appengine.tools.devappserver2.endpoints.test_utils.TestsWithStartResponse
 response_status
 
 response_headers
 
 response_exc_info
 
 start_response
 

Member Function Documentation

def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.assert_dispatch_to_spi (   self,
  request,
  config,
  spi_path,
  expected_spi_body_json = None 
)
Assert that dispatching a request to the SPI works.

Mock out the dispatcher.add_request and handle_spi_response, and use these
to ensure that the correct request is being sent to the back end when
Dispatch is called.

Args:
  request: An ApiRequest, the request to dispatch.
  config: A dict containing the API configuration.
  spi_path: A string containing the relative path to the SPI.
  expected_spi_body_json: If not None, this is a JSON object containing
the mock response sent by the back end.  If None, this will create an
empty response.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.check_cors (   self,
  request_headers,
  expect_response,
  expected_origin = None,
  expected_allow_headers = None,
  server_response = None 
)
Check that CORS headers are handled correctly.

Args:
  request_headers: A list of (header, value), to be used as headers in the
request.
  expect_response: A boolean, whether or not CORS headers are expected in
the response.
  expected_origin: A string or None.  If this is a string, this is the value
that's expected in the response's allow origin header.  This can be
None if expect_response is False.
  expected_allow_headers: A string or None.  If this is a string, this is
the value that's expected in the response's allow headers header.  If
this is None, then the response shouldn't have any allow headers
headers.
  server_response: A dispatcher.ResponseTuple or None.  The backend's
response, to be wrapped and returned as the server's response.  If
this is None, a generic response will be generated.

Returns:
  A string containing the body of the response that would be sent.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.setUp (   self)
Set up a dev Endpoints server.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_check_empty_response (   self)
Test that check_empty_response returns 204 for an empty response.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_check_non_empty_response (   self)
Test that check_empty_response returns None for a non-empty response.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_dispatch_rpc_error (   self)
Test than an RPC call that returns an error is handled properly.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_dispatch_spi_error (   self)
Check the error response if the SPI returns an error.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_handle_cors (   self)
Test CORS support on a regular request.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_handle_cors_preflight (   self)
Test a CORS preflight request.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_handle_cors_preflight_invalid (   self)
Test a CORS preflight request for an unaccepted OPTIONS request.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_handle_cors_preflight_request_headers (   self)
Test a CORS preflight request.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_handle_non_json_spi_response_cors (   self)
Test that an error response still handles CORS headers.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_handle_spi_response_batch_json_rpc (   self)
Verify that batch requests have an appropriate batch response.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_handle_spi_response_json_rpc (   self)
Verify headers transformed, JsonRpc response transformed, written.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_lily_uses_python_method_name (   self)
Verify Lily protocol correctly uses python method name.

This test verifies the fix to http://b/7189819
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_transform_json_rpc_response_batch (   self)
Verify request_id inserted into the body, and body into body.result.
def google.appengine.tools.devappserver2.endpoints.endpoints_server_test.DevAppserverEndpointsServerTest.test_transform_rest_response (   self)
Verify the response is reformatted correctly.

The documentation for this class was generated from the following file: