From 06f9348a6e143c3417e95feea5b1e76efe3a0e3a Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Mon, 3 Apr 2023 17:13:51 -0300 Subject: [PATCH] fix: change test according to function changes --- tests/test_cache.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/test_cache.py b/tests/test_cache.py index c52ceb38a..0dcc665f6 100644 --- a/tests/test_cache.py +++ b/tests/test_cache.py @@ -3,7 +3,7 @@ import tempfile from pathlib import Path import pytest -from langflow.cache.utils import PREFIX, compute_hash +from langflow.cache.utils import PREFIX, compute_hash, save_cache from langflow.interface.run import load_langchain_object @@ -42,13 +42,15 @@ def langchain_objects_are_equal(obj1, obj2): def test_cache_creation(basic_data_graph): # Compute hash for the input data_graph - computed_hash = compute_hash(basic_data_graph) - # Call process_graph function to build and cache the langchain_object - _ = load_langchain_object(basic_data_graph) - + is_first_message = True + computed_hash, langchain_object = load_langchain_object( + basic_data_graph, is_first_message=is_first_message + ) + save_cache(computed_hash, langchain_object, is_first_message) # Check if the cache file exists cache_file = Path(tempfile.gettempdir()) / f"{PREFIX}_{computed_hash}.dill" + assert cache_file.exists()