mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-01-30 13:55:58 -05:00
Update locustfile
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
parent
0906d6b906
commit
d9ff3a14b9
@ -7,31 +7,32 @@ class QuickStartUser(SequentialTaskSet):
|
|||||||
|
|
||||||
@task
|
@task
|
||||||
def captcha(self):
|
def captcha(self):
|
||||||
captcha_params = {"level":"some","media":"some","input_type":"some"}
|
# TODO: Iterate over parameters for a more comprehensive test
|
||||||
|
captcha_params = {"level":"easy","media":"image/png","input_type":"text"}
|
||||||
|
|
||||||
resp = self.client.post(path="/v1/captcha", json=captcha_params, name="/captcha")
|
resp = self.client.post(path="/v1/captcha", json=captcha_params, name="/captcha")
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
print("\nError on /captcha endpoint: ")
|
print("\nError on /captcha endpoint: ")
|
||||||
print(resp)
|
print(resp)
|
||||||
print(resp.text)
|
print(resp.text)
|
||||||
print("----------------END.C-------------------\n\n")
|
print("----------------END.CAPTCHA-------------------\n\n")
|
||||||
|
|
||||||
uuid = json.loads(resp.text).get("id")
|
uuid = json.loads(resp.text).get("id")
|
||||||
answerBody = {"answer": "qwer123","id": uuid}
|
answerBody = {"answer": "qwer123","id": uuid}
|
||||||
|
|
||||||
resp = self.client.get(path="/v1/media?id=%s" % uuid, name="/media")
|
resp = self.client.get(path="/v1/media?id=%s" % uuid, name="/media")
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
print("\nError on /captcha endpoint: ")
|
print("\nError on /media endpoint: ")
|
||||||
print(resp)
|
print(resp)
|
||||||
print(resp.text)
|
print(resp.text)
|
||||||
print("----------------END.C-------------------\n\n")
|
print("----------------END.MEDIA-------------------\n\n")
|
||||||
|
|
||||||
resp = self.client.post(path='/v1/answer', json=answerBody, name="/answer")
|
resp = self.client.post(path='/v1/answer', json=answerBody, name="/answer")
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
print("\nError on /captcha endpoint: ")
|
print("\nError on /answer endpoint: ")
|
||||||
print(resp)
|
print(resp)
|
||||||
print(resp.text)
|
print(resp.text)
|
||||||
print("----------------END.C-------------------\n\n")
|
print("----------------END.ANSWER-------------------\n\n")
|
||||||
|
|
||||||
|
|
||||||
class User(FastHttpUser):
|
class User(FastHttpUser):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user