def test_swob_request_copy(self): req = swob.Request.blank('/') req2 = internal_proxy.swob_request_copy(req) self.assertEquals(req.path, req2.path) self.assertEquals(req.path_info, req2.path_info) self.assertFalse(req is req2) self.assertEquals(req.headers, req2.headers) self.assertFalse(req.headers is req2.headers)
def test_handle_request(self): status_codes = [200] internal_proxy.Application = DumbApplicationFactory(status_codes) p = internal_proxy.InternalProxy() req = swob.Request.blank("/") orig_req = internal_proxy.swob_request_copy(req) resp = p._handle_request(req) self.assertEquals(req.path_info, orig_req.path_info)
def test_handle_request(self): status_codes = [200] internal_proxy.Application = DumbApplicationFactory(status_codes) p = internal_proxy.InternalProxy() req = swob.Request.blank('/') orig_req = internal_proxy.swob_request_copy(req) resp = p._handle_request(req) self.assertEquals(req.path_info, orig_req.path_info)
def test_handle_request_with_retries(self): status_codes = [500, 200] internal_proxy.Application = DumbApplicationFactory(status_codes) p = internal_proxy.InternalProxy(retries=3) req = swob.Request.blank("/") orig_req = internal_proxy.swob_request_copy(req) resp = p._handle_request(req) self.assertEquals(req.path_info, orig_req.path_info) self.assertEquals(p.upload_app.call_count, 2) self.assertEquals(resp.status_int, 200)
def test_handle_request_with_retries(self): status_codes = [500, 200] internal_proxy.Application = DumbApplicationFactory(status_codes) p = internal_proxy.InternalProxy(retries=3) req = swob.Request.blank('/') orig_req = internal_proxy.swob_request_copy(req) resp = p._handle_request(req) self.assertEquals(req.path_info, orig_req.path_info) self.assertEquals(p.upload_app.call_count, 2) self.assertEquals(resp.status_int, 200)