#NEWLINE# @ mock . patch . object ( questions . marketplace , 'get_zendesk' ) #NEWLINE# def test_submit_ticket( self , get_zendesk ) : #NEWLINE# #INDENT# 'Verify the http calls that are triggered by submit_ticket' #NEWLINE# zd = FauxZendesk ( 'https://appsmarket.zendesk.com' , 'x@y.z' , 'pwd' ) #NEWLINE# get_zendesk . return_value = zd #NEWLINE# submit_ticket ( 'a@example.com' , 'cat' , 'subject' , 'description' , [ 'tag1' , 'tag2' ] ) #NEWLINE# zd . client . request . assert_called_with ( 'https://appsmarket.zendesk.com/tickets.json?' , 'POST' , body = '{"ticket": {"requester_email": "a@example.com", "set_tags": "cat", "tags": ["tag1", "tag2"], "description": "description", "subject": "[TEST] subject"}}' , headers = { #NEWLINE# #INDENT# 'Content-Type' : 'application/json' , #NEWLINE# 'User-agent' : 'Zendesk Python Library v1.1.1' , #NEWLINE# #UNINDENT# } )