import web_services
json_input='{"scientificNames": ["Formica exsectoides", "Formica pecefica", "Formica polyctena"]}'
result_case_1 = web_services.testService_ResolveScientificNamesGNR_TNRS_WS_4_POST(json_input,["Formica polyctena", "Formica exsectoides"])
json_input='{"scientificNames": ["Setophaga striata", "Setophaga megnolia", "Setophaga angilae","Setophaga plumbea","Setophaga virens"]}'
result_case_1 = web_services.testService_ResolveScientificNamesGNR_TNRS_WS_4_POST(json_input,["Setophaga striata", "Setophaga plumbea"])
 	#prepare ws3 input
	separator = "|"
	ws4_input_GET = separator.join(input_list)
	#print "Case file input: " + ws4_input_GET
	ws4_input_POST = helper.prepare_json_input('{"scientificNames":[',input_list) 
	#print "Case file input: " + ws4_input_POST
	output_file = None
	output_file = helper.find_outputfile(output_files, file_no)
	if output_file == None:
		result_ws_4 = False
 		print "Could not find output file for " + f
		break		
	ws4_output = helper.create_list_file(output_file)
	#print "Case file output: " + ws2_output
 	ws4_result_GET = web_services.testService_ResolveScientificNamesGNR_TNRS_WS_4_GET(ws4_input_GET, ws4_output)
	ws4_result_POST = web_services.testService_ResolveScientificNamesGNR_TNRS_WS_4_POST(ws4_input_POST, ws4_output) 	
	ws4_result = ws4_result_GET and ws4_result_POST

	if ws4_result_GET and ws4_result_POST:
		print "Test succeeded for Case file: " + f
	elif ws4_result_GET:
		print "GET - method Test succeeded for Case file: " + f
	elif ws4_result_POST:
		print "POST - method Test succeeded for Case file: " + f
	print "-----------------------------------------------------" 
	ws4_results.append(ws4_result)

for result in ws4_results:
	result_ws_4 = (result_ws_4 and result)
 	if not(result_ws_4):
		break