How to use test_request_stats_named_endpoint method in locust

Best Python code snippet using locust

test_stats.py

Source:test_stats.py Github

copy

Full Screen

...123 path = "/no_content_length"124 r = l.client.get(path, stream=True)125 self.assertEqual(0, global_stats.get(path, "GET").avg_content_length)126 127 def test_request_stats_named_endpoint(self):128 class MyLocust(HttpLocust):129 host = "http://127.0.0.1:%i" % self.port130 131 locust = MyLocust()132 locust.client.get("/ultra_fast", name="my_custom_name")133 self.assertEqual(1, global_stats.get("my_custom_name", "GET").num_requests)134 135 def test_request_stats_query_variables(self):136 class MyLocust(HttpLocust):137 host = "http://127.0.0.1:%i" % self.port138 139 locust = MyLocust()140 locust.client.get("/ultra_fast?query=1")141 self.assertEqual(1, global_stats.get("/ultra_fast?query=1", "GET").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