diff --git a/core/tests/mocks/mock_plugin/mock_tool.py b/core/tests/mocks/mock_plugin/mock_tool.py index 3150d04e..501b10c3 100644 --- a/core/tests/mocks/mock_plugin/mock_tool.py +++ b/core/tests/mocks/mock_plugin/mock_tool.py @@ -2,7 +2,7 @@ @tool(return_direct=True) -def random_idea(topic, cat): - """Use to produce random ideas. Input is the topic.""" +def mock_tool(topic, cat): + """Used to test mock tools. Input is the topic.""" - return f"A random idea about {topic} :)" + return f"A mock about {topic} :)" diff --git a/core/tests/routes/plugins/test_plugin_toggle.py b/core/tests/routes/plugins/test_plugin_toggle.py index d37d30b7..73b62f25 100644 --- a/core/tests/routes/plugins/test_plugin_toggle.py +++ b/core/tests/routes/plugins/test_plugin_toggle.py @@ -22,16 +22,16 @@ def test_deactivate_plugin(client, just_installed_plugin): installed_plugins = response.json()["installed"] mock_plugin = [p for p in installed_plugins if p["id"] == "mock_plugin"] assert len(mock_plugin) == 1 # plugin installed - assert not mock_plugin[0]["active"] # plugin NOT active + assert mock_plugin[0]["active"] == False # plugin NOT active - # GET plugin info, plugin is not active + # GET single plugin info, plugin is not active response = client.get("/plugins/mock_plugin") - assert not response.json()["data"]["active"] + assert response.json()["data"]["active"] == False # tool has been taken away tools = get_embedded_tools(client) tool_names = list(map(lambda t: t["metadata"]["name"], tools)) - assert not "random_idea" in tool_names + assert not "mock_tool" in tool_names def test_reactivate_plugin(client, just_installed_plugin): @@ -47,13 +47,13 @@ def test_reactivate_plugin(client, just_installed_plugin): installed_plugins = response.json()["installed"] mock_plugin = [p for p in installed_plugins if p["id"] == "mock_plugin"] assert len(mock_plugin) == 1 # plugin installed - assert mock_plugin[0]["active"] # plugin active + assert mock_plugin[0]["active"] == True # plugin active - # GET plugin info, plugin is active + # GET single plugin info, plugin is active response = client.get("/plugins/mock_plugin") - assert response.json()["data"]["active"] + assert response.json()["data"]["active"] == True # tool has been re-embedded tools = get_embedded_tools(client) tool_names = list(map(lambda t: t["metadata"]["name"], tools)) - assert "random_idea" in tool_names \ No newline at end of file + assert "mock_tool" in tool_names \ No newline at end of file diff --git a/core/tests/routes/plugins/test_plugins_install_uninstall.py b/core/tests/routes/plugins/test_plugins_install_uninstall.py index 992b81a8..cd53b110 100644 --- a/core/tests/routes/plugins/test_plugins_install_uninstall.py +++ b/core/tests/routes/plugins/test_plugins_install_uninstall.py @@ -29,7 +29,7 @@ def test_plugin_install_upload_zip(client, just_installed_plugin): # check whether new tools have been embedded tools = get_embedded_tools(client) tool_names = list(map(lambda t: t["metadata"]["name"], tools)) - assert "random_idea" in tool_names + assert "mock_tool" in tool_names def test_plugin_uninstall(client, just_installed_plugin): @@ -50,4 +50,4 @@ def test_plugin_uninstall(client, just_installed_plugin): # plugin tool disappeared tools = get_embedded_tools(client) tool_names = list(map(lambda t: t["metadata"]["name"], tools)) - assert "random_idea" not in tool_names + assert "mock_tool" not in tool_names