From 8be64db3a73e54f3ec31edd52798af7bc1000bfd Mon Sep 17 00:00:00 2001 From: Ignacio Heredia Date: Tue, 27 Aug 2024 11:53:19 +0200 Subject: [PATCH] test: improve tool tests --- tests/catalog/tools.py | 38 +++++++++++++++++++++----------------- tests/main.py | 1 + 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/tests/catalog/tools.py b/tests/catalog/tools.py index e5fe09d..6d5fc0b 100644 --- a/tests/catalog/tools.py +++ b/tests/catalog/tools.py @@ -33,23 +33,27 @@ assert isinstance(tools_tags, list) assert 'docker' in tools_tags -# Explore an individual tool -tool_name = tools_list[0] - -# Get tool config -tool_conf = Tools.get_config( - item_name=tool_name, - vo='vo.ai4eosc.eu', -) -assert isinstance(tool_conf, dict) -assert 'general' in tool_conf.keys() - -# Get tool metadata -tool_meta = Tools.get_metadata( - item_name=tool_name, -) -assert isinstance(tool_meta, dict) -assert 'title' in tool_meta.keys() +# Explore individual tools +# Contrary than for modules, we do this for all tools because tool configurations are +# particular for each tool +for tool_name in tools_list: + + print(f' - Testing {tool_name}') + + # Get tool config + tool_conf = Tools.get_config( + item_name=tool_name, + vo='vo.ai4eosc.eu', + ) + assert isinstance(tool_conf, dict) + assert 'general' in tool_conf.keys() + + # Get tool metadata + tool_meta = Tools.get_metadata( + item_name=tool_name, + ) + assert isinstance(tool_meta, dict) + assert 'title' in tool_meta.keys() #TODO: we should not be able to get config or metadata for a module_name diff --git a/tests/main.py b/tests/main.py index 556a7f5..8f966a5 100644 --- a/tests/main.py +++ b/tests/main.py @@ -9,6 +9,7 @@ #TODO: move to proper testing package #TODO: rename test script: modules --> test_modules +#TODO: add spinners import catalog.modules import catalog.tools