Commit bc9a4414 authored by Hamza Baqa's avatar Hamza Baqa

clean code

parent 11bf42d3
......@@ -33,22 +33,22 @@ DOCKER_GW = os.environ['SEMTEST_ONTOLOGY_VALIDATOR_URL']
URL_to_send_validation = DOCKER_GW + "/SemTest/ontology"
print("I will send the file to URL_to_send_validation")
ioppytest_cli._ui_display_markdown_text("All the infos \n" + "My URL_to_send_validation : "+ URL_to_send_validation +"\n" + "My file_1_to_validate_path : " + file_1_to_validate_path +"\n" + "My file_2_to_validate_path : "+ file_2_to_validate_path + "\n")
#ioppytest_cli._ui_display_markdown_text("All the infos \n" + "My URL_to_send_validation : "+ URL_to_send_validation +"\n" + "My file_1_to_validate_path : " + file_1_to_validate_path +"\n" + "My file_2_to_validate_path : "+ file_2_to_validate_path + "\n")
ioppytest_cli._ui_display_markdown_text("Waiting for validation ............ ")
ioppytest_cli._ui_display_markdown_text("Preparing to send the file 1 to the OV to the address : " + URL_to_send_validation )
#ioppytest_cli._ui_display_markdown_text("Preparing to send the file 1 to the OV to the address : " + URL_to_send_validation )
print('Preparing to send the file 1 to the OV to the address : ' + URL_to_send_validation )
#Upload file 1
file_1 = {'file': open(file_1_to_validate_path, 'rb')}
r_1 = requests.post(URL_to_send_validation, files=file_1)
print('file 1 sent and the response ' + r_1.text)
ioppytest_cli._ui_display_markdown_text('file 1 sent and the response ' + r_1.text)
#ioppytest_cli._ui_display_markdown_text('file 1 sent and the response ' + r_1.text)
j_1 = json.loads(r_1.text)
print('file 1 uploaded and it cointains these ontologies ' + str(j_1) )
ioppytest_cli._ui_display_markdown_text('file 1 uploaded and it cointains these ontologies ' + str(j_1))
#ioppytest_cli._ui_display_markdown_text('file 1 uploaded and it cointains these ontologies ' + str(j_1))
......@@ -57,10 +57,10 @@ print('Preparing to send the file 2 to the OV to the address : '+ URL_to_send_v
file_2 = {'file': open(file_2_to_validate_path, 'rb')}
r_2 = requests.post(URL_to_send_validation, files=file_2)
print('file 2 sent and the response ' + r_2.text)
ioppytest_cli._ui_display_markdown_text('file 2 sent and the response ' + r_2.text)
#ioppytest_cli._ui_display_markdown_text('file 2 sent and the response ' + r_2.text)
j_2 = json.loads(r_2.text)
print('file 2 uploaded and it cointains these ontologies ' + str(j_2) )
ioppytest_cli._ui_display_markdown_text('file 2 uploaded and it cointains these ontologies ' + str(j_2))
#ioppytest_cli._ui_display_markdown_text('file 2 uploaded and it cointains these ontologies ' + str(j_2))
def dico_to_ont_list_ontopath(my_dico):
......@@ -75,12 +75,6 @@ def dico_to_ont_list_ontoname(my_dico):
li.append(my_ob['OntoName'])
return li
print("User 1 has these ontologies: ",dico_to_ont_list_ontopath(j_1))
print("User 2 has these ontologies: ",dico_to_ont_list_ontopath(j_2))
ioppytest_cli._ui_display_markdown_text("User 1 has these ontologies: ",dico_to_ont_list_ontopath(j_1))
ioppytest_cli._ui_display_markdown_text("User 2 has these ontologies: ",dico_to_ont_list_ontopath(j_2))
def lengths(x):
if isinstance(x,list):
......@@ -121,6 +115,4 @@ to_send.append(val_1_obj)
to_send.append(val_2_obj)
to_send.append(val_3_obj)
print('report generated \n' + tabulate(to_send, tablefmt="grid") )
ioppytest_cli._ui_display_markdown_text(tabulate(to_send, tablefmt="grid"))
print('report sent')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment