(exchange, skipped_properties)
| 38 | |
| 39 | |
| 40 | def 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 |
no test coverage detected
searching dependent graphs…