Create test_image_captcha.py

This commit is contained in:
Andrei 2024-10-05 23:50:08 +03:00
parent 65aca84601
commit 4718688d37
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
from tests.conftest import BaseTest
from python3_anticaptcha.image_captcha import ImageToTextCaptcha
class TestImageCaptcha(BaseTest):
captcha_file = "files/captcha-image.jpg"
captcha_url = (
"https://raw.githubusercontent.com/AndreiDrang/python3-anticaptcha/refs/heads/main/files/captcha-image.jpg"
)
kwargs_params = {
"phrase": False,
"case": False,
"numeric": 0,
"math": False,
"minLength": 0,
"maxLength": 0,
"languagePool": "en",
}
def test_methods_exists(self):
assert "captcha_handler" in ImageToTextCaptcha.__dict__.keys()
assert "aio_captcha_handler" in ImageToTextCaptcha.__dict__.keys()
instance = ImageToTextCaptcha(api_key=self.API_KEY)
assert instance.create_task_payload.clientKey == self.API_KEY
def test_args(self):
instance = ImageToTextCaptcha(api_key=self.API_KEY)
assert instance.create_task_payload.clientKey == self.API_KEY