def test_from_biotools_to_galaxy(self, name, json_path, xml_path):
# Open json to be the content of the requests_mock
json_answer = main.json_from_file(json_path)
with requests_mock.mock() as m:
m.get('https://bio.tools/api/tool/' + name + '/version/1.0',\
json=json_answer)
json = main.json_from_biotools(name, '1.0')
biotool = main.json_to_biotool(json)
tmp_file = 'tmp_test_xml.xml'
main.write_xml(biotool,tmp_file)
tmp_file_list = glob("tmp_*.xml")
try:
for temp_file in tmp_file_list:
if len(tmp_file_list) > 1:
xml_path = os.path.splitext(json_path)[0] + \
str(re.findall('\d+', temp_file)[0]) + '.xml'
self.assertTrue(filecmp.cmp(xml_path,temp_file))
finally:
for temp_file in tmp_file_list:
os.remove(temp_file)
评论列表
文章目录