From 8139b743c2e552f7d7c4851c6aeac1d7fe81f4bc Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 8 Mar 2024 23:41:35 -0300 Subject: [PATCH] Fix URLComponent build method and update test_url_component --- src/backend/langflow/components/data/URL.py | 2 +- tests/test_data_components.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/langflow/components/data/URL.py b/src/backend/langflow/components/data/URL.py index 5fe0ec8f6..2db18e7db 100644 --- a/src/backend/langflow/components/data/URL.py +++ b/src/backend/langflow/components/data/URL.py @@ -15,7 +15,7 @@ class URLComponent(CustomComponent): "urls": {"display_name": "URL"}, } - async def build( + def build( self, urls: list[str], ) -> list[Record]: diff --git a/tests/test_data_components.py b/tests/test_data_components.py index ff65f408c..5cce5ad5f 100644 --- a/tests/test_data_components.py +++ b/tests/test_data_components.py @@ -172,4 +172,5 @@ def test_directory_without_mocks(): def test_url_component(): url_component = data.URLComponent() # the url component can be used to load the contents of a website - record = url_component.build("https://example.com") + records = url_component.build(["https://langflow.org"]) + assert all(record.data for record in records)