#NEWLINE# def test_basic_auth_with_unquoted_realm( self ) : #NEWLINE# #INDENT# opener = OpenerDirector ( ) #NEWLINE# password_manager = MockPasswordManager ( ) #NEWLINE# auth_handler = urllib2 . HTTPBasicAuthHandler ( password_manager ) #NEWLINE# realm = 'ACME Widget Store' #NEWLINE# http_handler = MockHTTPHandler ( 401 , ( 'WWW-Authenticate: Basic realm=%s\r\n\r\n' % realm ) ) #NEWLINE# opener . add_handler ( auth_handler ) #NEWLINE# opener . add_handler ( http_handler ) #NEWLINE# msg = 'Basic Auth Realm was unquoted' #NEWLINE# with test_support . check_warnings ( ( msg , UserWarning ) ) : #NEWLINE# #INDENT# self . _test_basic_auth ( opener , auth_handler , 'Authorization' , realm , http_handler , password_manager , 'http://acme.example.com/protected' , 'http://acme.example.com/protected' )