Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
| 1 |
import pytest |
| 2 |
from siosocks.exceptions import SocksException |
| 3 |
|
| 4 |
|
| 5 |
@pytest.mark.asyncio |
| 6 |
async def test_socks_success(pair_factory, Client, socks): |
| 7 |
client = Client( |
| 8 |
socks_host=socks.host, |
| 9 |
socks_port=socks.port, |
| 10 |
socks_version=5, |
| 11 |
username="foo", |
| 12 |
password="bar", |
| 13 |
) |
| 14 |
async with pair_factory(client): |
| 15 |
pass |
| 16 |
|
| 17 |
|
| 18 |
@pytest.mark.asyncio |
| 19 |
async def test_socks_fail(pair_factory, Client, socks): |
| 20 |
client = Client( |
| 21 |
socks_host=socks.host, |
| 22 |
socks_port=socks.port, |
| 23 |
socks_version=5, |
| 24 |
username="bar", |
| 25 |
password="bar", |
| 26 |
) |
| 27 |
with pytest.raises(SocksException): |
| 28 |
async with pair_factory(client): |
| 29 |
pass |