mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 10:34:20 +01:00
23 lines
517 B
Python
23 lines
517 B
Python
import httpx
|
|
import pytest
|
|
|
|
from cashu.tor.tor import TorProxy
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
@pytest.mark.skip(reason="Tor is not installed on CI")
|
|
async def test_tor_setup():
|
|
tor = TorProxy(timeout=False)
|
|
tor.run_daemon()
|
|
socks_host, socks_port = "localhost", 9050
|
|
|
|
proxies = {
|
|
"all://": f"socks5://{socks_host}:{socks_port}",
|
|
}
|
|
client = httpx.AsyncClient(
|
|
proxies=proxies, # type: ignore
|
|
)
|
|
|
|
resp = await client.get("https://www.wikipedia.org/")
|
|
resp.raise_for_status()
|