From 74af14b37371019e2e5c663d4206ca44dac1d513 Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Tue, 18 Jun 2024 22:42:14 -0300 Subject: [PATCH] refactor: Update docs_path in test_data_components.py to fix directory path The code changes in test_data_components.py update the `docs_path` variable to fix the directory path for loading components. The previous path was incorrect, and this update ensures that the correct path is used. This refactor improves the accuracy and reliability of the code. --- tests/unit/test_data_components.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_data_components.py b/tests/unit/test_data_components.py index d90a1d868..a29f46021 100644 --- a/tests/unit/test_data_components.py +++ b/tests/unit/test_data_components.py @@ -7,6 +7,7 @@ import pytest import respx from dictdiffer import diff from httpx import Response + from langflow.components import data @@ -181,7 +182,7 @@ def test_directory_without_mocks(): # check if the directory component can load them # just check if the number of results is the same as the number of files directory_component = data.DirectoryComponent() - docs_path = Path(__file__).parent.parent / "docs" / "docs" / "components" + docs_path = Path(__file__).parent.parent.parent / "docs" / "docs" / "components" directory_component.set_attributes({"path": str(docs_path), "use_multithreading": False}) results = directory_component.load_directory() docs_files = list(docs_path.glob("*.mdx")) @@ -194,5 +195,5 @@ def test_url_component(): # the url component can be used to load the contents of a website _data = url_component.fetch_content() assert all(value.data for value in _data) - assert all(value.content for value in _data) + assert all(value.text for value in _data) assert all(value.source for value in _data)