def test_get_request_states(self): request_state.start_request('1') request_state.start_request('2') request_state.start_request('3') self.assertEqual(3, len(request_state.get_request_states())) self.assertItemsEqual( [request_state.get_request_state(request_id) for request_id in ['1', '2', '3']], request_state.get_request_states())
def test_get_request_states(self): request_state.start_request('1') request_state.start_request('2') request_state.start_request('3') self.assertEqual(3, len(request_state.get_request_states())) self.assertItemsEqual([ request_state.get_request_state(request_id) for request_id in ['1', '2', '3'] ], request_state.get_request_states())
def handle_shutdown_request(self, environ): response, exc = shutdown.Handle(self.get_user_environ(environ)) if exc: for request in request_state.get_request_states(): if request.request_id != environ[http_runtime_constants.REQUEST_ID_ENVIRON]: request.inject_exception(exc[1]) return response
def handle_shutdown_request(self, environ): response, exc = shutdown.Handle(self.get_user_environ(environ)) if exc: for request in request_state.get_request_states(): if (request.request_id != environ[http_runtime_constants.REQUEST_ID_ENVIRON]): request.inject_exception(exc[1]) return response
def test_end_request_function(self): request_state._request_states = {'id': self.request_state} self.mox.StubOutWithMock(self.request_state, 'end_request') self.request_state.end_request() self.mox.ReplayAll() request_state.end_request('id') self.mox.VerifyAll() self.assertEqual([], request_state.get_request_states())
def test_start_request_function(self): request_state.start_request('id') self.assertEqual(1, len(request_state.get_request_states())) self.assertEqual('id', request_state.get_request_state('id').request_id)