Skip to content

Commit 15f8e1f

Browse files
author
Andrei
committed
Update test_hcaptcha.py
1 parent 8dd5d03 commit 15f8e1f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/test_hcaptcha.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from tests.conftest import BaseTest
66
from python3_capsolver.hcaptcha import HCaptcha, HCaptchaClassification
77
from python3_capsolver.core.enum import HCaptchaTypeEnm, HCaptchaClassificationTypeEnm
8+
from python3_capsolver.core.serializer import CaptchaResponseSer
89

910
HCAPTCHA_KEY = "3ceb8624-1970-4e6b-91d5-70317b70b651"
1011
PAGE_URL = "https://accounts.hcaptcha.com/demo"
@@ -275,6 +276,19 @@ def test_api_key_err(self):
275276
queries=[self.image_body],
276277
question=self.question,
277278
).captcha_handler()
279+
assert isinstance(result, CaptchaResponseSer)
280+
assert result.errorId == 1
281+
assert result.errorCode == "ERROR_KEY_DENIED_ACCESS"
282+
assert not result.solution
283+
284+
async def test_aio_api_key_err(self):
285+
result = await HCaptchaClassification(
286+
api_key=self.get_random_string(36),
287+
captcha_type=self.captcha_type,
288+
queries=[self.image_body],
289+
question=self.question,
290+
).aio_captcha_handler()
291+
assert isinstance(result, CaptchaResponseSer)
278292
assert result.errorId == 1
279293
assert result.errorCode == "ERROR_KEY_DENIED_ACCESS"
280294
assert not result.solution

0 commit comments

Comments
 (0)