How to use test_response_413_without_absolute_limit method in tempest

Best Python code snippet using tempest_python

test_rest_client.py

Source:test_rest_client.py Github

copy

Full Screen

...264 def test_response_413(self):265 self.assertRaises(exceptions.OverLimit,266 self.rest_client._error_checker,267 **self.set_data("413"))268 def test_response_413_without_absolute_limit(self):269 self.assertRaises(exceptions.RateLimitExceeded,270 self.rest_client._error_checker,271 **self.set_data("413", absolute_limit=False))272 def test_response_415(self):273 self.assertRaises(exceptions.InvalidContentType,274 self.rest_client._error_checker,275 **self.set_data("415"))276 def test_response_422(self):277 self.assertRaises(exceptions.UnprocessableEntity,278 self.rest_client._error_checker,279 **self.set_data("422"))280 def test_response_500_with_text(self):281 # _parse_resp is expected to return 'str'282 self.assertRaises(exceptions.ServerFault,283 self.rest_client._error_checker,284 **self.set_data("500"))285 def test_response_501_with_text(self):286 self.assertRaises(exceptions.NotImplemented,287 self.rest_client._error_checker,288 **self.set_data("501"))289 def test_response_500_with_dict(self):290 r_body = '{"resp_body": {"err": "fake_resp_body"}}'291 self.assertRaises(exceptions.ServerFault,292 self.rest_client._error_checker,293 **self.set_data("500", r_body=r_body))294 def test_response_501_with_dict(self):295 r_body = '{"resp_body": {"err": "fake_resp_body"}}'296 self.assertRaises(exceptions.NotImplemented,297 self.rest_client._error_checker,298 **self.set_data("501", r_body=r_body))299 def test_response_bigger_than_400(self):300 # Any response code, that bigger than 400, and not in301 # (401, 403, 404, 409, 413, 422, 500, 501)302 self.assertRaises(exceptions.UnexpectedResponseCode,303 self.rest_client._error_checker,304 **self.set_data("402"))305class TestRestClientErrorCheckerTEXT(TestRestClientErrorCheckerJSON):306 c_type = "text/plain"307 def test_fake_content_type(self):308 # This test is required only in one exemplar309 # Any response code, that bigger than 400, and not in310 # (401, 403, 404, 409, 413, 422, 500, 501)311 self.assertRaises(exceptions.InvalidContentType,312 self.rest_client._error_checker,313 **self.set_data("405", enc="fake_enc"))314 def test_response_413_without_absolute_limit(self):315 # Skip this test because rest_client cannot get overLimit message316 # from text body.317 pass318class TestRestClientUtils(BaseRestClientTestClass):319 def _is_resource_deleted(self, resource_id):320 if not isinstance(self.retry_pass, int):321 return False322 if self.retry_count >= self.retry_pass:323 return True324 self.retry_count = self.retry_count + 1325 return False326 def setUp(self):327 self.fake_http = fake_http.fake_httplib2()328 super(TestRestClientUtils, self).setUp()...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful