diff --git a/.github/workflows/api-tests.yml b/.github/workflows/api-tests.yml index 02583cda06..f08befefb8 100644 --- a/.github/workflows/api-tests.yml +++ b/.github/workflows/api-tests.yml @@ -88,3 +88,6 @@ jobs: - name: Run Workflow run: uv run --project api bash dev/pytest/pytest_workflow.sh + + - name: Run Tool + run: uv run --project api bash dev/pytest/pytest_tools.sh diff --git a/api/tests/integration_tests/tools/__mock/http.py b/api/tests/integration_tests/tools/__mock/http.py index 42cf87e317..de9711ab38 100644 --- a/api/tests/integration_tests/tools/__mock/http.py +++ b/api/tests/integration_tests/tools/__mock/http.py @@ -5,6 +5,8 @@ import httpx import pytest from _pytest.monkeypatch import MonkeyPatch +from core.helper import ssrf_proxy + class MockedHttp: @staticmethod @@ -29,6 +31,6 @@ class MockedHttp: @pytest.fixture def setup_http_mock(request, monkeypatch: MonkeyPatch): - monkeypatch.setattr(httpx, "request", MockedHttp.httpx_request) + monkeypatch.setattr(ssrf_proxy, "make_request", MockedHttp.httpx_request) yield monkeypatch.undo() diff --git a/api/tests/integration_tests/tools/api_tool/test_api_tool.py b/api/tests/integration_tests/tools/api_tool/test_api_tool.py index 9acc94e110..7c1a200c8f 100644 --- a/api/tests/integration_tests/tools/api_tool/test_api_tool.py +++ b/api/tests/integration_tests/tools/api_tool/test_api_tool.py @@ -34,10 +34,11 @@ parameters = { def test_api_tool(setup_http_mock): tool = ApiTool( entity=ToolEntity( - identity=ToolIdentity(provider="", author="", name="", label=I18nObject()), + identity=ToolIdentity(provider="", author="", name="", label=I18nObject(en_US="test tool")), ), api_bundle=ApiToolBundle(**tool_bundle), runtime=ToolRuntime(tenant_id="", credentials={"auth_type": "none"}), + provider_id="test_tool", ) headers = tool.assembling_request(parameters) response = tool.do_http_request(tool.api_bundle.server_url, tool.api_bundle.method, headers, parameters) diff --git a/dev/pytest/pytest_tools.sh b/dev/pytest/pytest_tools.sh index 5b1de8b6dd..0b1a8c9877 100755 --- a/dev/pytest/pytest_tools.sh +++ b/dev/pytest/pytest_tools.sh @@ -1,4 +1,4 @@ #!/bin/bash set -x -pytest api/tests/integration_tests/tools/test_all_provider.py +pytest api/tests/integration_tests/tools