#NEWLINE# def testSetHeaders( self ) : #NEWLINE# #INDENT# suds_client = mock . Mock ( ) #NEWLINE# network_code = 'my network code is code' #NEWLINE# app_name = 'application name' #NEWLINE# oauth_header = { 'oauth' , 'header' } #NEWLINE# self . dfp_client . network_code = network_code #NEWLINE# self . dfp_client . application_name = app_name #NEWLINE# self . dfp_client . oauth2_client . CreateHttpHeader . return_value = soap_header #NEWLINE# self . header_handler . SetHeaders ( suds_client ) #NEWLINE# suds_client . factory . create . assert_called_once_with ( 'SoapRequestHeader' ) #NEWLINE# soap_header = suds_client . factory . create . return_value #NEWLINE# self . assertEqual ( network_code , soap_header . networkCode ) #NEWLINE# self . assertEqual ( '' . join ( [ app_name , googleads . dfp . _DfpHeaderHandler . _LIB_SIG ] ) , soap_header . applicationName ) #NEWLINE# suds_client . set_options . assert_any_call ( soapheaders = soap_header , headers = oauth_header )