mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 10:34:20 +01:00
22 lines
452 B
Python
22 lines
452 B
Python
import pytest
|
|
import requests
|
|
|
|
from cashu.tor.tor import TorProxy
|
|
|
|
|
|
def test_tor_setup():
|
|
s = requests.Session()
|
|
|
|
tor = TorProxy(timeout=False)
|
|
tor.run_daemon()
|
|
socks_host, socks_port = "localhost", 9050
|
|
|
|
proxies = {
|
|
"http": f"socks5://{socks_host}:{socks_port}",
|
|
"https": f"socks5://{socks_host}:{socks_port}",
|
|
}
|
|
s.proxies.update(proxies)
|
|
|
|
resp = s.get("https://google.com")
|
|
resp.raise_for_status()
|