Skip to content

Commit

Permalink
Update test_rotate.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiDrang committed Dec 7, 2023
1 parent bb6a97c commit 4a84e36
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions tests/test_rotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from tests.conftest import BaseTest
from python_rucaptcha.core.enums import RotateCaptchaEnm
from python_rucaptcha.rotate_captcha import RotateCaptcha
from python_rucaptcha.core.serializer import GetTaskResultResponseSer
from python_rucaptcha.core.serializer import CreateTaskResponseSer, GetTaskResultResponseSer


class TestRotateCaptcha(BaseTest):
Expand Down Expand Up @@ -140,10 +140,6 @@ async def test_aio_basic_data_base64(self):
Fail tests
"""

def test_wrong_method(self):
with pytest.raises(ValueError):
RotateCaptcha(rucaptcha_key=self.RUCAPTCHA_KEY, method=self.get_random_string(length=5))

def test_no_captcha(self):
instance = RotateCaptcha(rucaptcha_key=self.RUCAPTCHA_KEY)

Expand All @@ -152,10 +148,8 @@ def test_no_captcha(self):
assert isinstance(result, dict) is True
assert result["errorId"] != 0
assert result["taskId"] is None
assert result["errorBody"] == RotateCaptcha.NO_CAPTCHA_ERR
assert result["captchaSolve"] == {}

assert result.keys() == GetTaskResultResponseSer().to_dict().keys()
assert result.keys() == CreateTaskResponseSer().to_dict().keys()

@pytest.mark.asyncio
async def test_aio_no_captcha(self):
Expand All @@ -166,8 +160,6 @@ async def test_aio_no_captcha(self):
assert isinstance(result, dict) is True
assert result["errorId"] != 0
assert result["taskId"] is None
assert result["errorBody"] == RotateCaptcha.NO_CAPTCHA_ERR
assert result["captchaSolve"] == {}
assert result.keys() == GetTaskResultResponseSer().to_dict().keys()

def test_wrong_link(self):
Expand All @@ -178,7 +170,6 @@ def test_wrong_link(self):
assert isinstance(result, dict) is True
assert result["errorId"] != 0
assert result["taskId"] is None
assert result["captchaSolve"] == {}
assert result.keys() == GetTaskResultResponseSer().to_dict().keys()

def test_wrong_base64(self):
Expand All @@ -189,8 +180,7 @@ def test_wrong_base64(self):
assert isinstance(result, dict) is True
assert result["errorId"] != 0
assert result["taskId"] is None
assert result["captchaSolve"] == {}
assert result.keys() == GetTaskResultResponseSer().to_dict().keys()
assert result.keys() == CreateTaskResponseSer().to_dict().keys()

@pytest.mark.asyncio
async def test_aio_wrong_link(self):
Expand All @@ -201,7 +191,6 @@ async def test_aio_wrong_link(self):
assert isinstance(result, dict) is True
assert result["errorId"] != 0
assert result["taskId"] is None
assert result["captchaSolve"] == {}
assert result.keys() == GetTaskResultResponseSer().to_dict().keys()

@pytest.mark.asyncio
Expand All @@ -215,5 +204,4 @@ async def test_aio_wrong_base64(self):
assert isinstance(result, dict) is True
assert result["errorId"] != 0
assert result["taskId"] is None
assert result["captchaSolve"] == {}
assert result.keys() == GetTaskResultResponseSer().to_dict().keys()
assert result.keys() == CreateTaskResponseSer().to_dict().keys()

0 comments on commit 4a84e36

Please sign in to comment.