MCPcopy Create free account
hub / github.com/ccxt/ccxt / test_http_proxy

Function test_http_proxy

python/ccxt/test/exchange/sync/test_proxies.py:40–50  ·  view source on GitHub ↗
(exchange, skipped_properties)

Source from the content-addressed store, hash-verified

38
39
40def test_http_proxy(exchange, skipped_properties):
41 method = 'httpProxy'
42 proxy_server_ip = '5.75.153.75'
43 [proxy_url, http_proxy, https_proxy, socks_proxy] = test_shared_methods.remove_proxy_options(exchange, skipped_properties)
44 exchange.http_proxy = 'http://' + proxy_server_ip + ':8911'
45 ip_check_url = 'https://api.ipify.org/'
46 response = exchange.fetch(ip_check_url)
47 assert response == proxy_server_ip, exchange.id + ' ' + method + ' test failed. Returned response is ' + response + ' while it should be "' + proxy_server_ip + '"'
48 # reset the instance property
49 test_shared_methods.set_proxy_options(exchange, skipped_properties, proxy_url, http_proxy, https_proxy, socks_proxy)
50 return True
51
52
53# with the below method we test out all variations of possible proxy options, so at least 2 of them should be set together, and such cases must throw exception

Callers 1

test_proxiesFunction · 0.70

Calls 1

fetchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…