#NEWLINE# def test_pf_autoscale_post_call_testing_uk( self ) : #NEWLINE# #INDENT# api_id = self . setup_useable_api_call ( ) #NEWLINE# with self . app as c : #NEWLINE# #INDENT# with c . session_transaction ( ) as sess : #NEWLINE# #INDENT# self . setup_admin_login ( sess ) #NEWLINE# #UNINDENT# data = { #NEWLINE# #INDENT# 'api_verb' : 'GET' , #NEWLINE# 'testing' : False , #NEWLINE# 'api_url' : '{ddi}/groups' , #NEWLINE# 'api_token' : 'test_token' , #NEWLINE# 'api_id' : str ( api_id ) , #NEWLINE# 'ddi' : '123456' , #NEWLINE# 'data_center' : 'lon' , #NEWLINE# 'testing' : True , #NEWLINE# #UNINDENT# } #NEWLINE# with mock . patch ( 'requests.get' ) as patched_get : #NEWLINE# #INDENT# type ( patched_get . return_value ) . content = mock . PropertyMock ( return_value = '{"groups_links": [], "groups": []}' ) #NEWLINE# type ( patched_get . return_value ) . status_code = mock . PropertyMock ( return_value = 200 ) #NEWLINE# type ( patched_get . return_value ) . headers = mock . PropertyMock ( return_value = '{"via": "1.1 Repose (Repose/2.12)","x-response-id": "a10adb69-4d9f-4457-bda4-e2429f334895","transfer-encoding": "chunked","server": "Jetty(8.0.y.z-SNAPSHOT)","date": "Tue, 18 Mar 2014 19:52:26 GMT","content-type": "application/json"}' ) #NEWLINE# response = c . post ( '/autoscale/api/call/process' , data = json . dumps ( data ) , content_type = 'application/json' ) #NEWLINE# #UNINDENT# #UNINDENT# data = json . loads ( response . data ) #NEWLINE# assert data . get ( 'response_code' ) , 'No response code received' #NEWLINE# assert data . get ( 'api_url' ) , 'API URL was not found' #NEWLINE# assert data . get ( 'response_headers' ) , 'No response headers were received' #NEWLINE# assert data . get ( 'response_body' ) , 'No response content was received' #NEWLINE# assert data . get ( 'request_headers' ) , 'No request headers was received' #NEWLINE# assert data . get ( 'response_code' ) , 'No response status code was received'