Skip to content

Commit

Permalink
more precise tests for tool sync
Browse files Browse the repository at this point in the history
  • Loading branch information
pieroit committed Aug 4, 2023
1 parent 36f9d17 commit a536d6b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions core/tests/routes/plugins/test_plugin_toggle.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ def test_deactivate_plugin(client, just_installed_plugin):

# tool has been taken away
tools = get_embedded_tools(client)
assert len(tools) == 1
tool_names = list(map(lambda t: t["metadata"]["name"], tools))
assert not "mock_tool" in tool_names
assert "mock_tool" not in tool_names
assert "get_the_time" in tool_names # from core_plugin


def test_reactivate_plugin(client, just_installed_plugin):
Expand All @@ -55,5 +57,7 @@ def test_reactivate_plugin(client, just_installed_plugin):

# tool has been re-embedded
tools = get_embedded_tools(client)
assert len(tools) == 2
tool_names = list(map(lambda t: t["metadata"]["name"], tools))
assert "mock_tool" in tool_names
assert "mock_tool" in tool_names
assert "get_the_time" in tool_names # from core_plugin
6 changes: 5 additions & 1 deletion core/tests/routes/plugins/test_plugins_install_uninstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ def test_plugin_install_upload_zip(client, just_installed_plugin):
# plugin has been actually extracted in (mock) plugins folder
assert os.path.exists(mock_plugin_final_folder)

# check whether new tools have been embedded
# check whether new tool has been embedded
tools = get_embedded_tools(client)
assert len(tools) == 2
tool_names = list(map(lambda t: t["metadata"]["name"], tools))
assert "mock_tool" in tool_names
assert "get_the_time" in tool_names # from core_plugin


def test_plugin_uninstall(client, just_installed_plugin):
Expand All @@ -49,5 +51,7 @@ def test_plugin_uninstall(client, just_installed_plugin):

# plugin tool disappeared
tools = get_embedded_tools(client)
assert len(tools) == 1
tool_names = list(map(lambda t: t["metadata"]["name"], tools))
assert "mock_tool" not in tool_names
assert "get_the_time" in tool_names # from core_plugin

0 comments on commit a536d6b

Please sign in to comment.