|
4 | 4 | from python3_capsolver.binance import Binance |
5 | 5 | from python3_capsolver.core.enum import BinanceCaptchaTaskEnm |
6 | 6 |
|
| 7 | +from python3_capsolver.core.serializer import CaptchaResponseSer, BinanceCaptchaTaskSer |
| 8 | + |
7 | 9 |
|
8 | 10 | class TestBinanceBase(BaseTest): |
9 | 11 | def test_captcha_handler_exist(self): |
@@ -44,3 +46,35 @@ def test_no_validateId(self): |
44 | 46 | captcha_type=BinanceCaptchaTaskEnm.BinanceCaptchaTask, |
45 | 47 | websiteURL=self.get_random_string(36), |
46 | 48 | ) |
| 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