From 4718688d37ef38c06072ab24167016f9ca9931a7 Mon Sep 17 00:00:00 2001 From: Andrei Date: Sat, 5 Oct 2024 23:50:08 +0300 Subject: [PATCH] Create test_image_captcha.py --- tests/test_image_captcha.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/test_image_captcha.py diff --git a/tests/test_image_captcha.py b/tests/test_image_captcha.py new file mode 100644 index 0000000..0804737 --- /dev/null +++ b/tests/test_image_captcha.py @@ -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