#NEWLINE# def test_generate_request_header( self ) : #NEWLINE# #INDENT# with patch . multiple ( kerberos_module_name , authGSSClientInit = clientInit_complete , authGSSClientResponse = clientResponse , authGSSClientStep = clientStep_continue ) : #NEWLINE# #INDENT# response = requests . Response ( ) #NEWLINE# response . url = 'http://www.example.org/' #NEWLINE# response . headers = { #NEWLINE# #INDENT# 'www-authenticate' : 'negotiate token' , #NEWLINE# #UNINDENT# } #NEWLINE# host = urlparse ( response . url ) . hostname #NEWLINE# auth = requests_kerberos . HTTPKerberosAuth ( ) #NEWLINE# self . assertEqual ( auth . generate_request_header ( response , host ) , 'Negotiate GSSRESPONSE' ) #NEWLINE# clientInit_complete . assert_called_with ( 'HTTP@www.example.org' , gssflags = ( kerberos . GSS_C_MUTUAL_FLAG | kerberos . GSS_C_SEQUENCE_FLAG ) ) #NEWLINE# clientStep_continue . assert_called_with ( 'CTX' , 'token' ) #NEWLINE# clientResponse . assert_called_with ( 'CTX' )