#NEWLINE# def test_redirect_fragment( self ) : #NEWLINE# #INDENT# redirected_url = 'http://www.example.com/index.html#OK\r\n\r\n' #NEWLINE# hh = MockHTTPHandler ( 302 , ( 'Location: ' + redirected_url ) ) #NEWLINE# hdeh = urllib2 . HTTPDefaultErrorHandler ( ) #NEWLINE# hrh = urllib2 . HTTPRedirectHandler ( ) #NEWLINE# o = build_test_opener ( hh , fp , hrh ) #NEWLINE# fp = o . open ( 'http://www.example.com' ) #NEWLINE# self . assertEqual ( fp . geturl ( ) , redirected_url . strip ( ) )