Skip to content

Commit

Permalink
Update test_audio.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiDrang committed Dec 6, 2023
1 parent 4736d63 commit e2f7ac9
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions tests/test_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ def test_no_captcha(self):
result = instance.captcha_handler()

assert isinstance(result, dict) is True
assert result["errorId"] == 12
assert isinstance(result["solution"]["token"], str) is True
assert result.keys() == GetTaskResultResponseSer().to_dict().keys()
assert result["errorId"] in (12, 5)

@pytest.mark.asyncio
async def test_aio_no_captcha(self):
Expand All @@ -150,7 +148,7 @@ async def test_aio_no_captcha(self):
result = await instance.aio_captcha_handler()

assert isinstance(result, dict) is True
assert result["errorId"] == 5
assert result["errorId"] in (12, 5)
assert result.keys() == GetTaskResultResponseSer().to_dict().keys()

def test_wrong_link(self):
Expand All @@ -159,7 +157,7 @@ def test_wrong_link(self):
result = instance.captcha_handler(captcha_link=self.get_random_string(length=50))

assert isinstance(result, dict) is True
assert result["errorId"] == 5
assert result["errorId"] in (12, 5)
assert result.keys() == GetTaskResultResponseSer().to_dict().keys()

def test_wrong_path(self):
Expand All @@ -174,8 +172,7 @@ def test_wrong_base64(self):
result = instance.captcha_handler(captcha_base64=self.get_random_string(length=50).encode(encoding="UTF-8"))

assert isinstance(result, dict) is True
assert result["errorId"] == 5
assert result.keys() == GetTaskResultResponseSer().to_dict().keys()
assert result["errorId"] in (12, 5)

@pytest.mark.asyncio
async def test_aio_wrong_link(self):
Expand All @@ -184,8 +181,7 @@ async def test_aio_wrong_link(self):
result = await instance.aio_captcha_handler(captcha_link=self.get_random_string(length=50))

assert isinstance(result, dict) is True
assert result["errorId"] == 12
assert result.keys() == GetTaskResultResponseSer().to_dict().keys()
assert result["errorId"] in (12, 5)

@pytest.mark.asyncio
async def test_aio_wrong_path(self):
Expand All @@ -203,5 +199,4 @@ async def test_aio_wrong_base64(self):
)

assert isinstance(result, dict) is True
assert result["errorId"] == 5
assert result.keys() == GetTaskResultResponseSer().to_dict().keys()
assert result["errorId"] in (12, 5)

0 comments on commit e2f7ac9

Please sign in to comment.