unit test for proxy checking
Posted
by zubin71
on Stack Overflow
See other posts from Stack Overflow
or by zubin71
Published on 2010-04-11T12:35:03Z
Indexed on
2010/04/11
12:43 UTC
Read the original article
Hit count: 283
Proxy configuration of a machine can be easily fetched using
def check_proxy():
import urllib2
http_proxy = urllib2.getproxies().get('http')
I need to write a test for the above written function. In order to do that I need to:-
- Set the system-wide proxy to an invalid URL during the test(sounds like a bad idea).
- Supply an invalid URL to http_proxy.
How can I achieve either of the above?
© Stack Overflow or respective owner