Skip to content

Commit e4ec149

Browse files
committed
use url instead of path in locust file
1 parent 05eb5f8 commit e4ec149

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

tests/locustfile-functional.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ class QuickStartUser(SequentialTaskSet):
2424
def captcha(self):
2525
captcha_params = {"level":"debug","media":"image/png","input_type":"text", "size":"350x100"}
2626

27-
with self.client.post(path="/v2/captcha", json=captcha_params, name="/captcha", catch_response = True) as resp:
27+
with self.client.post(url="/v2/captcha", json=captcha_params, name="/captcha", catch_response = True) as resp:
2828
if resp.status_code != 200:
2929
resp.failure("Status was not 200: " + resp.text)
3030
captchaJson = resp.json()
3131
uuid = captchaJson.get("id")
3232
if not uuid:
3333
resp.failure("uuid not returned on /captcha endpoint: " + resp.text)
3434

35-
with self.client.get(path="/v2/media?id=%s" % uuid, name="/media", stream=True, catch_response = True) as resp:
35+
with self.client.get(url="/v2/media?id=%s" % uuid, name="/media", stream=True, catch_response = True) as resp:
3636
if resp.status_code != 200:
3737
resp.failure("Status was not 200: " + resp.text)
3838

@@ -41,7 +41,7 @@ def captcha(self):
4141
ocrAnswer = self.solve(uuid, media)
4242

4343
answerBody = {"answer": ocrAnswer,"id": uuid}
44-
with self.client.post(path='/v2/answer', json=answerBody, name="/answer", catch_response=True) as resp:
44+
with self.client.post(url='/v2/answer', json=answerBody, name="/answer", catch_response=True) as resp:
4545
if resp.status_code != 200:
4646
resp.failure("Status was not 200: " + resp.text)
4747
else:

tests/locustfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def captcha(self):
2626
# TODO: Iterate over parameters for a more comprehensive test
2727
captcha_params = {"level":"easy","media":"image/png","input_type":"text", "size":"350x100"}
2828

29-
resp = self.client.post(path="/v2/captcha", json=captcha_params, name="/captcha")
29+
resp = self.client.post(url="/v2/captcha", json=captcha_params, name="/captcha")
3030
if resp.status_code != 200:
3131
print("\nError on /captcha endpoint: ")
3232
print(resp)
@@ -36,14 +36,14 @@ def captcha(self):
3636
uuid = json.loads(resp.text).get("id")
3737
answerBody = {"answer": "qwer123","id": uuid}
3838

39-
resp = self.client.get(path="/v2/media?id=%s" % uuid, name="/media")
39+
resp = self.client.get(url="/v2/media?id=%s" % uuid, name="/media")
4040
if resp.status_code != 200:
4141
print("\nError on /media endpoint: ")
4242
print(resp)
4343
print(resp.text)
4444
print("----------------END.MEDIA-------------------\n\n")
4545

46-
resp = self.client.post(path='/v2/answer', json=answerBody, name="/answer")
46+
resp = self.client.post(url='/v2/answer', json=answerBody, name="/answer")
4747
if resp.status_code != 200:
4848
print("\nError on /answer endpoint: ")
4949
print(resp)

0 commit comments

Comments
 (0)