#NEWLINE# @ patch ( 'salt.utils.event.get_event' ) #NEWLINE# def test_hook_can_handle_get_parameters( self , get_event ) : #NEWLINE# #INDENT# self . _app . mod_opts [ 'webhook_disable_auth' ] = True #NEWLINE# event = MagicMock ( ) #NEWLINE# event . fire_event . return_value = True #NEWLINE# get_event . return_value = event #NEWLINE# response = self . fetch ( '/hook/my_service/?param=1&param=2' , body = json . dumps ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) , method = 'POST' , headers = { #NEWLINE# #INDENT# 'Content-Type' : self . content_type_map [ 'json' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( response . code , 200 , response . body ) #NEWLINE# host = urlparse ( host . effective_url ) . netloc #NEWLINE# event . fire_event . assert_called_once_with ( { #NEWLINE# #INDENT# 'headers' : { #NEWLINE# #INDENT# 'Content-Length' : '2' , #NEWLINE# 'Connection' : 'close' , #NEWLINE# 'Content-Type' : 'application/json' , #NEWLINE# 'Host' : host , #NEWLINE# 'Accept-Encoding' : 'gzip' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'post' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'get' : { #NEWLINE# #INDENT# 'param' : [ '1' , '2' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , 'salt/netapi/hook/my_service/' )