Example #1
0
 async def test_fail_aioimagecaptcha_const_context(self):
     with ImageToTextTask.aioImageToTextTask(
             anticaptcha_key=self.anticaptcha_key_fail,
             save_format=ImageToTextTask.SAVE_FORMATS[0]) as imagecaptcha:
         response = await imagecaptcha.captcha_handler(
             captcha_link=self.image_url)
         assert 1 == response["errorId"]
Example #2
0
 async def test_fail_aioimagecaptcha_temp(self):
     imagecaptcha = ImageToTextTask.aioImageToTextTask(
         anticaptcha_key=self.anticaptcha_key_fail,
         save_format=ImageToTextTask.SAVE_FORMATS[1],
     )
     response = await imagecaptcha.captcha_handler(
         captcha_link=self.image_url)
     assert 1 == response["errorId"]
    async def test_response_aioimagecaptcha(self):
        imagecaptcha = ImageToTextTask.aioImageToTextTask(
            anticaptcha_key=self.anticaptcha_key_fail
        )
        # check response type
        assert isinstance(imagecaptcha, ImageToTextTask.aioImageToTextTask)

        response = await imagecaptcha.captcha_handler(captcha_link=self.image_url)

        # check response type
        assert isinstance(response, dict)
        # check all dict keys
        assert ["errorId", "errorCode", "errorDescription"] == list(response.keys())