Skip to content
Snippets Groups Projects
Commit 044bbf6a authored by UMEC Mathieu's avatar UMEC Mathieu
Browse files

cleaning code and starting the unittest

parent 08b9d804
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -3,7 +3,17 @@ import sys
sys.path.append('C:\\Users\\mumec\\Desktop\\Dossier_gitlab_local\\traitement_des_données')
import Mapping_using_the_API
class TestMappingAPI(unittest.TestCase):
class Testutils(unittest.TestCase):
"""
recup_all_inf_excel(file)
send_request_to_mapping_api(url, data_json, head, met='POST')
excel_file_writer(dataframe, name_out_file, sheetname="Resultats")
pre_cut(listed)
"""
def test_recup_all_inf_excel(self):
def test_send_request_to_Mapping_API(self):
result =Mapping_using_the_API.send_request_to_Mapping_API('https://rampdb.nih.gov/api/pathways-from-analytes',["hmdb:HMDB0000064"],{'Accept': '*/*','Content-Type': 'application/json'})
......@@ -13,13 +23,58 @@ class TestMappingAPI(unittest.TestCase):
with self.assertRaises(ValueError):
Mapping_using_the_API.send_request_to_Mapping_API('https://rampdb.nih.gov/api/pathways-from-analytes',[],{'Accept': '*/*','Content-Type': 'application/json'})
"""
def test_mapping_from_RAMP_API(self):
def test_excel_file_writer(self):
def test_excel_file_writer(self):
"""
def test_pre_cut(self):
class TestMappingAPI(unittest.TestCase):
"""
mapping_ramp_api(metabolites_list, outfile, inf="opti")
m_ora_cpdb(accnumbers, acctype, cpdbidsbg=None,
pthreshold=0.05, infos="all",
ofile="C:\\Users\\mumec\\Desktop\\test_out_cpdb.xlsx")
equiv_from_ma_api(metabolites_list)
"""
def test_mapping_ramp_api(self):
def test_m_ora_cpdb(self):
def test_equiv_from_ma_api(self):
class TestCPDBannexe(unittest.TestCase):
"""
get_cpdb_available_fset_types(entity_type)
get_cpdb_available_accesion_types(entity_type)
get_cpdb_available_accesion_id(acctype, accnumbers)
get_cpdb_version()
"""
def test_get_cpdb_available_fset_types(self):
def test_get_cpdb_available_accesion_types(self):
def test_get_cpdb_available_accesion_id(self):
def test_get_cpdb_version(self):
class TestMultiMapping(unittest.TestCase):
"""
multimapping_ramp(file, num_col, outfiles, infpath="Yes")
opti_multimapping(file, outfolder, mapping="YES")
"""
def test_multimapping_ramp(self):
def test_opti_multimapping(self):
if __name__=='__main__':
unittest.main()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment