This commit is contained in:
Andrei 2019-08-21 04:36:40 +03:00
parent 06b9c006c9
commit e056ed301e
3 changed files with 16 additions and 6 deletions

View File

@ -53,7 +53,7 @@ async def run():
anticaptcha_key=ANTICAPTCHA_KEY
).get_queue_status(queue_id=1)
print(resolved)
except Exception as err:
print(err)

View File

@ -183,7 +183,9 @@ class aioAntiCaptchaControl:
# complaint on image captcha
if captcha_type == "image":
async with aiohttp.ClientSession() as session:
async with session.post(incorrect_imagecaptcha_url, json=payload) as resp:
async with session.post(
incorrect_imagecaptcha_url, json=payload
) as resp:
return await resp.json()
# complaint on re-captcha
elif captcha_type == "recaptcha":

16
test.py
View File

@ -458,7 +458,9 @@ class TestAntiCaptcha(object):
assert response["errorId"] == 1
with pytest.raises(ValueError):
assert result.complaint_on_result(reported_id=86007, captcha_type="not_image")
assert result.complaint_on_result(
reported_id=86007, captcha_type="not_image"
)
# AntiCaptcha Control
def test_true_balance(self):
@ -632,7 +634,9 @@ class TestAntiCaptcha(object):
assert response["errorId"] == 1
with pytest.raises(ValueError):
assert result.complaint_on_result(reported_id=432423342, captcha_type="not_image")
assert result.complaint_on_result(
reported_id=432423342, captcha_type="not_image"
)
@asyncio.coroutine
def test_fail_aioapp_stats(self):
@ -734,7 +738,9 @@ class TestAntiCaptcha(object):
anticaptcha_key=self.anticaptcha_key_true
)
# complaint on result
response = yield result.complaint_on_result(reported_id=432423342, captcha_type="image")
response = yield result.complaint_on_result(
reported_id=432423342, captcha_type="image"
)
# check response type
assert type(response) is dict
# check all dict keys
@ -742,7 +748,9 @@ class TestAntiCaptcha(object):
# check error code
assert response["errorId"] == 16
# complaint on result
response = yield result.complaint_on_result(reported_id=432423342, captcha_type="recaptcha")
response = yield result.complaint_on_result(
reported_id=432423342, captcha_type="recaptcha"
)
# check response type
assert type(response) is dict
# check all dict keys