From 68405dde002486accc51465972ed9eabc8e25628 Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Wed, 17 Apr 2024 13:14:40 -0700 Subject: [PATCH] Rename test file --- tests/resources/{foobar.txt => foobar-many.txt} | 0 tests/unit/utils/test_file_utils.py | 12 ++++++------ 2 files changed, 6 insertions(+), 6 deletions(-) rename tests/resources/{foobar.txt => foobar-many.txt} (100%) diff --git a/tests/resources/foobar.txt b/tests/resources/foobar-many.txt similarity index 100% rename from tests/resources/foobar.txt rename to tests/resources/foobar-many.txt diff --git a/tests/unit/utils/test_file_utils.py b/tests/unit/utils/test_file_utils.py index 54aa918762..ba1e845fa4 100644 --- a/tests/unit/utils/test_file_utils.py +++ b/tests/unit/utils/test_file_utils.py @@ -8,17 +8,17 @@ class TestFileUtils: def test_load_file(self): - file = utils.load_file("tests/resources/foobar.txt") + file = utils.load_file("tests/resources/foobar-many.txt") assert file.decode("utf-8").startswith("foobar foobar foobar") assert len(file.decode("utf-8")) == 4563 def test_load_files(self): - sources = ["tests/resources/foobar.txt", "tests/resources/foobar.txt", "tests/resources/small.png"] + sources = ["tests/resources/foobar-many.txt", "tests/resources/foobar-many.txt", "tests/resources/small.png"] files = utils.load_files(sources, futures_executor=futures.ThreadPoolExecutor(max_workers=1)) assert len(files) == 2 - test_file = files[utils.str_to_hash("tests/resources/foobar.txt")] + test_file = files[utils.str_to_hash("tests/resources/foobar-many.txt")] assert len(test_file) == 4563 assert test_file.decode("utf-8").startswith("foobar foobar foobar") @@ -27,7 +27,7 @@ def test_load_files(self): assert small_file[:8] == b"\x89PNG\r\n\x1a\n" def test_load_file_with_loader(self): - file = utils.load_file("tests/resources/foobar.txt") + file = utils.load_file("tests/resources/foobar-many.txt") artifacts = TextLoader(max_tokens=MAX_TOKENS, embedding_driver=MockEmbeddingDriver()).load(file) assert len(artifacts) == 39 @@ -35,12 +35,12 @@ def test_load_file_with_loader(self): assert artifacts[0].value.startswith("foobar foobar foobar") def test_load_files_with_loader(self): - sources = ["tests/resources/foobar.txt"] + sources = ["tests/resources/foobar-many.txt"] files = utils.load_files(sources) loader = TextLoader(max_tokens=MAX_TOKENS, embedding_driver=MockEmbeddingDriver()) collection = loader.load_collection(list(files.values())) - test_file_artifacts = collection[loader.to_key(files[utils.str_to_hash("tests/resources/foobar.txt")])] + test_file_artifacts = collection[loader.to_key(files[utils.str_to_hash("tests/resources/foobar-many.txt")])] assert len(test_file_artifacts) == 39 assert isinstance(test_file_artifacts, list) assert test_file_artifacts[0].value.startswith("foobar foobar foobar")