Skip to content

Commit

Permalink
add swarm test case for step load mode
Browse files Browse the repository at this point in the history
  • Loading branch information
delulu committed Dec 6, 2019
1 parent 05ba11e commit 21ea8d6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion locust/test/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
ALTERNATIVE_HOST = 'http://localhost'
SWARM_DATA_WITH_HOST = {'locust_count': 5, 'hatch_rate': 5, 'host': ALTERNATIVE_HOST}
SWARM_DATA_WITH_NO_HOST = {'locust_count': 5, 'hatch_rate': 5}

SWARM_DATA_WITH_STEP_LOAD = {"locust_count":5, "hatch_rate":2, "step_locust_count":2, "step_duration": "2m"}

class TestWebUI(LocustTestCase):
def setUp(self):
Expand Down Expand Up @@ -210,3 +210,9 @@ class MyLocust2(Locust):
self.assertEqual(200, response.status_code)
self.assertNotIn("http://example.com", response.content.decode("utf-8"))
self.assertIn("setting this will override the host on all Locust classes", response.content.decode("utf-8"))

def test_swarm_in_step_load_mode(self):
runners.locust_runner.step_load = True
response = requests.post("http://127.0.0.1:%i/swarm" % self.web_port, SWARM_DATA_WITH_STEP_LOAD)
self.assertEqual(200, response.status_code)
self.assertIn("Step Load Mode", response.text)

0 comments on commit 21ea8d6

Please sign in to comment.