Skip to content

Commit ad39752

Browse files
author
Andrei
committed
Update test_recaptcha.py
1 parent c37a3d1 commit ad39752

1 file changed

Lines changed: 3 additions & 32 deletions

File tree

tests/test_recaptcha.py

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,11 @@ def test_solve(self, captcha_type: str):
7070
assert resp.errorDescription is None
7171
assert resp.solution is not None
7272

73-
"""def test_solve_context(self):
74-
with ReCaptcha(
75-
api_key=self.API_KEY,
76-
captcha_type=self.captcha_type,
77-
websiteURL=self.pageurl,
78-
websiteKey=self.googlekey,
79-
) as instance:
80-
resp = instance.captcha_handler()
81-
assert isinstance(resp, CaptchaResponseSer)
82-
assert resp.status == ResponseStatusEnm.Ready
83-
assert resp.errorId == 0
84-
assert resp.errorCode is None
85-
assert resp.errorDescription is None
86-
assert resp.solution is not None
87-
88-
async def test_aio_solve(self):
73+
@pytest.mark.parametrize("captcha_type", captcha_types)
74+
async def test_aio_solve(self, captcha_type: str):
8975
resp = await ReCaptcha(
9076
api_key=self.API_KEY,
91-
captcha_type=self.captcha_type,
77+
captcha_type=captcha_type,
9278
websiteURL=self.pageurl,
9379
websiteKey=self.googlekey,
9480
).aio_captcha_handler()
@@ -99,21 +85,6 @@ async def test_aio_solve(self):
9985
assert resp.errorDescription is None
10086
assert resp.solution is not None
10187

102-
async def test_aio_solve_context(self):
103-
with ReCaptcha(
104-
api_key=self.API_KEY,
105-
captcha_type=self.captcha_type,
106-
websiteURL=self.pageurl,
107-
websiteKey=self.googlekey,
108-
) as instance:
109-
resp = await instance.aio_captcha_handler()
110-
assert isinstance(resp, CaptchaResponseSer)
111-
assert resp.status == ResponseStatusEnm.Ready
112-
assert resp.errorId == 0
113-
assert resp.errorCode is None
114-
assert resp.errorDescription is None
115-
assert resp.solution is not None"""
116-
11788
"""
11889
Failed tests
11990
"""

0 commit comments

Comments
 (0)