Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
test: use real datasource crawl and stream event values (#43413)
Asuka Minato2372ab58e8d4
diff --git a/api/tests/unit_tests/core/datasource/test_stream_node_events.py b/api/tests/unit_tests/core/datasource/test_stream_node_events.pyindex 58e18ca00e4..1b3005af1ac 100644--- a/api/tests/unit_tests/core/datasource/test_stream_node_events.py+++ b/api/tests/unit_tests/core/datasource/test_stream_node_events.py@@ -7,6 +7,7 @@ from pytest_mock import MockerFixturefrom core.datasource.datasource_manager import DatasourceManagerfrom core.datasource.entities.datasource_entities import DatasourceMessagefrom graphon.node_events import StreamCompletedEvent+from graphon.runtime import VariablePooldef _gen_var_stream() -> Generator[DatasourceMessage]:@@ -35,10 +36,11 @@ def test_stream_node_events_accumulates_variables(mocker: MockerFixture) -> Nonetenant_id="t",parameters_for_log={},datasource_info={"user_id": "u"},- variable_pool=mocker.Mock(),- datasource_param=type("P", (), {"workspace_id": "w", "page_id": "pg", "type": "t"})(),+ variable_pool=VariablePool(),+ datasource_param=None,online_drive_request=None,credentials={},))assert isinstance(events[-1], StreamCompletedEvent)+ assert events[-1].node_run_result.outputs["a"] == "xy"diff --git a/api/tests/unit_tests/core/datasource/test_website_crawl.py b/api/tests/unit_tests/core/datasource/test_website_crawl.pyindex d589acb747b..fc2ff7b1e22 100644--- a/api/tests/unit_tests/core/datasource/test_website_crawl.py+++ b/api/tests/unit_tests/core/datasource/test_website_crawl.py@@ -14,6 +14,7 @@ and ensure proper handling of crawl options, status checking, and data retrievalfrom unittest.mock import Mock, create_autospec, patch+import httpximport pytestfrom pytest_mock import MockerFixture@@ -568,8 +569,7 @@ class TestWebsiteService:"api_key": "test_key",}- mock_response = Mock()- mock_response.json.return_value = {"code": 200, "data": {"taskId": "task-789"}}+ mock_response = httpx.Response(200, json={"code": 200, "data": {"taskId": "task-789"}})mock_httpx_post = mocker.patch("services.data_source.website_service._adaptive_http_client.post",return_value=mock_response,@@ -913,8 +913,7 @@ class TestErrorHandling:# Simulate API error for non-existent jobfrom core.rag.extractor.watercrawl.exceptions import WaterCrawlBadRequestError- mock_response = Mock()- mock_response.status_code = 404+ mock_response = httpx.Response(404, json={"message": "Crawl job not found", "errors": {}})mock_instance.get_crawl_request.side_effect = WaterCrawlBadRequestError(mock_response)provider = WaterCrawlProvider(api_key="test_key")@@ -1356,8 +1355,7 @@ class TestProviderSpecificFeatures:"api_key": "test_key",}- mock_response = Mock()- mock_response.json.return_value = {+ response_data = {"code": 200,"data": {"title": "Single Page Title",@@ -1365,6 +1363,7 @@ class TestProviderSpecificFeatures:"url": "https://example.com/page",},}+ mock_response = httpx.Response(200, json=response_data)mocker.patch("services.data_source.website_service._jina_http_client.get", return_value=mock_response)from services.data_source.website_service import WebsiteCrawlApiRequest