diff --git a/anticaptcha_examples/custom_result_handler_example.py b/anticaptcha_examples/custom_result_handler_example.py index 5cdd5bd..6f243f1 100644 --- a/anticaptcha_examples/custom_result_handler_example.py +++ b/anticaptcha_examples/custom_result_handler_example.py @@ -10,9 +10,7 @@ This module is used to obtain the result of solving the task in "manual" mode TASK_ID = 123456 # prepare client -custom_result = CustomResultHandler.CustomResultHandler( - anticaptcha_key=ANTICAPTCHA_KEY -) +custom_result = CustomResultHandler.CustomResultHandler(anticaptcha_key=ANTICAPTCHA_KEY) response = custom_result.task_handler(task_id=TASK_ID) print(response) @@ -34,4 +32,4 @@ async def run(): if __name__ == "__main__": loop = asyncio.get_event_loop() loop.run_until_complete(run()) - loop.close() \ No newline at end of file + loop.close() diff --git a/tests/test_CustomResultHandler.py b/tests/test_CustomResultHandler.py index 9b6caa0..32e2801 100644 --- a/tests/test_CustomResultHandler.py +++ b/tests/test_CustomResultHandler.py @@ -48,7 +48,7 @@ class TestAntiCaptcha(MainAntiCaptcha): ) # check response type assert isinstance(custom_result, CustomResultHandler.CustomResultHandler) - # get balance + response = custom_result.task_handler(task_id=self.WRONG_TASK_ID) # check response type assert isinstance(response, dict) @@ -65,7 +65,7 @@ class TestAntiCaptcha(MainAntiCaptcha): ) # check response type assert isinstance(custom_result, CustomResultHandler.aioCustomResultHandler) - # get balance + response = await custom_result.task_handler(task_id=self.WRONG_TASK_ID) # check response type assert isinstance(response, dict) @@ -83,7 +83,7 @@ class TestAntiCaptcha(MainAntiCaptcha): custom_result = CustomResultHandler.CustomResultHandler( anticaptcha_key=self.anticaptcha_key_fail ) - # get balance + response = custom_result.task_handler(task_id=self.WRONG_TASK_ID) # check error code assert 1 == response["errorId"] @@ -93,7 +93,7 @@ class TestAntiCaptcha(MainAntiCaptcha): with CustomResultHandler.CustomResultHandler( anticaptcha_key=self.anticaptcha_key_fail ) as custom_result: - # get balance + response = custom_result.task_handler(task_id=self.WRONG_TASK_ID) # check error code assert 1 == response["errorId"] @@ -104,7 +104,7 @@ class TestAntiCaptcha(MainAntiCaptcha): custom_result = CustomResultHandler.aioCustomResultHandler( anticaptcha_key=self.anticaptcha_key_fail ) - # get balance + response = await custom_result.task_handler(task_id=self.WRONG_TASK_ID) # check error code assert 1 == response["errorId"] @@ -115,7 +115,7 @@ class TestAntiCaptcha(MainAntiCaptcha): with CustomResultHandler.aioCustomResultHandler( anticaptcha_key=self.anticaptcha_key_fail ) as custom_result: - # get balance + response = await custom_result.task_handler(task_id=self.WRONG_TASK_ID) # check error code assert 1 == response["errorId"] @@ -129,7 +129,7 @@ class TestAntiCaptcha(MainAntiCaptcha): custom_result = CustomResultHandler.CustomResultHandler( anticaptcha_key=self.anticaptcha_key_true ) - # get balance + response = custom_result.task_handler(task_id=self.WRONG_TASK_ID) # check error code assert 16 == response["errorId"] @@ -139,7 +139,7 @@ class TestAntiCaptcha(MainAntiCaptcha): with CustomResultHandler.CustomResultHandler( anticaptcha_key=self.anticaptcha_key_true ) as custom_result: - # get balance + response = custom_result.task_handler(task_id=self.WRONG_TASK_ID) # check error code assert 16 == response["errorId"] @@ -150,7 +150,7 @@ class TestAntiCaptcha(MainAntiCaptcha): custom_result = CustomResultHandler.aioCustomResultHandler( anticaptcha_key=self.anticaptcha_key_true ) - # get balance + response = await custom_result.task_handler(task_id=self.WRONG_TASK_ID) # check error code assert 16 == response["errorId"] @@ -161,7 +161,7 @@ class TestAntiCaptcha(MainAntiCaptcha): with CustomResultHandler.aioCustomResultHandler( anticaptcha_key=self.anticaptcha_key_true ) as custom_result: - # get balance + response = await custom_result.task_handler(task_id=self.WRONG_TASK_ID) # check error code assert 16 == response["errorId"]