Skip to content

Commit

Permalink
test: improve tool tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Aug 27, 2024
1 parent 9bcca2a commit 8be64db
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
38 changes: 21 additions & 17 deletions tests/catalog/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8be64db

Please sign in to comment.