How to use test_request_stats_named_endpoint_request_name method in locust

Best Python code snippet using locust

test_stats.py

Source:test_stats.py Github

copy

Full Screen

...667 self.assertEqual(0, self.runner.stats.get(path, "GET").avg_content_length)668 def test_request_stats_named_endpoint(self):669 self.locust.client.get("/ultra_fast", name="my_custom_name")670 self.assertEqual(1, self.runner.stats.get("my_custom_name", "GET").num_requests)671 def test_request_stats_named_endpoint_request_name(self):672 self.locust.client.request_name = "my_custom_name_1"673 self.locust.client.get("/ultra_fast")674 self.assertEqual(1, self.runner.stats.get("my_custom_name_1", "GET").num_requests)675 self.locust.client.request_name = None676 def test_request_stats_named_endpoint_rename_request(self):677 with self.locust.client.rename_request("my_custom_name_3"):678 self.locust.client.get("/ultra_fast")679 self.assertEqual(1, self.runner.stats.get("my_custom_name_3", "GET").num_requests)680 def test_request_stats_query_variables(self):681 self.locust.client.get("/ultra_fast?query=1")682 self.assertEqual(1, self.runner.stats.get("/ultra_fast?query=1", "GET").num_requests)683 def test_request_stats_put(self):684 self.locust.client.put("/put")685 self.assertEqual(1, self.runner.stats.get("/put", "PUT").num_requests)...

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 locust 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