Skip to content

Commit 065e0ab

Browse files
author
Andrei
committed
Update test_binance.py
1 parent beccd24 commit 065e0ab

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

tests/test_binance.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from python3_capsolver.binance import Binance
55
from python3_capsolver.core.enum import BinanceCaptchaTaskEnm
66

7+
from python3_capsolver.core.serializer import CaptchaResponseSer, BinanceCaptchaTaskSer
8+
79

810
class TestBinanceBase(BaseTest):
911
def test_captcha_handler_exist(self):
@@ -44,3 +46,35 @@ def test_no_validateId(self):
4446
captcha_type=BinanceCaptchaTaskEnm.BinanceCaptchaTask,
4547
websiteURL=self.get_random_string(36),
4648
)
49+
50+
51+
class TestBinanceCaptchaTaskBase(BaseTest):
52+
def test_instance(self):
53+
instance = Binance(
54+
api_key=self.get_random_string(36),
55+
captcha_type=BinanceCaptchaTaskEnm.BinanceCaptchaTask,
56+
websiteURL="https://www.milanuncios.com/",
57+
validateId="3621a4fef82f4ab4a00e8b07465761c5",
58+
)
59+
60+
def test_solve(self):
61+
instance = Binance(
62+
api_key=self.get_random_string(36),
63+
captcha_type=BinanceCaptchaTaskEnm.BinanceCaptchaTask,
64+
websiteURL="https://www.milanuncios.com/",
65+
validateId="3621a4fef82f4ab4a00e8b07465761c5",
66+
**{"proxyType": "socks5", "proxyAddress": "72.217.216.239", "proxyPort": 4145},
67+
)
68+
result = instance.captcha_handler()
69+
assert isinstance(result, CaptchaResponseSer)
70+
71+
async def test_aio_solve(self):
72+
instance = Binance(
73+
api_key=self.get_random_string(36),
74+
captcha_type=BinanceCaptchaTaskEnm.BinanceCaptchaTask,
75+
websiteURL="https://www.milanuncios.com/",
76+
validateId="3621a4fef82f4ab4a00e8b07465761c5",
77+
**{"proxyType": "socks5", "proxyAddress": "72.217.216.239", "proxyPort": 4145},
78+
)
79+
result = await instance.aio_captcha_handler()
80+
assert isinstance(result, CaptchaResponseSer)

0 commit comments

Comments
 (0)