#NEWLINE# def test_proxy_https( self ) : #NEWLINE# #INDENT# o = OpenerDirector ( ) #NEWLINE# ph = urllib2 . ProxyHandler ( dict ( https = 'proxy.example.com:3128' ) ) #NEWLINE# o . add_handler ( ph ) #NEWLINE# meth_spec = [ [ ( 'https_open' , 'return response' ) ] ] #NEWLINE# handlers = add_ordered_mock_handlers ( o , o ) #NEWLINE# req = Request ( 'https://www.example.com/' ) #NEWLINE# self . assertEqual ( req . get_host ( ) , 'www.example.com' ) #NEWLINE# r = o . open ( req ) #NEWLINE# self . assertEqual ( req . get_host ( ) , 'proxy.example.com:3128' ) #NEWLINE# self . assertEqual ( [ ( handlers [ 0 ] , 'https_open' ) ] , [ tup [ 0 : 2 ] for tup in o . calls ] )