Skip to content

Commit

Permalink
Consolidate test sample documents into one subdir
Browse files Browse the repository at this point in the history
This gets rid of the extra testdata directory for functional tests
and collapses those into a single one, using the existing
sample_documents subdir of the unit tests.

Signed-off-by: Ben Browning <[email protected]>
  • Loading branch information
bbrowning committed Nov 8, 2024
1 parent e0698d6 commit 93fae83
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/functional/test_chunkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
# First Party
from instructlab.sdg.utils.chunkers import DocumentChunker

TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "testdata")
TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "testdata")


def test_chunk_pdf(tmp_path):
pdf_path = Path(os.path.join(TEST_DATA_DIR, "sample_documents", "phoenix.pdf"))
leaf_node = [
{
"documents": ["Lorem ipsum"],
"filepaths": [Path(os.path.join(TEST_DATA_DIR, "phoenix.pdf"))],
"filepaths": [pdf_path],
"taxonomy_path": "knowledge",
}
]
Expand All @@ -33,7 +34,7 @@ def test_chunk_pdf(tmp_path):


def test_chunk_md(tmp_path):
markdown_path = Path(os.path.join(TEST_DATA_DIR, "phoenix.md"))
markdown_path = Path(os.path.join(TEST_DATA_DIR, "sample_documents", "phoenix.md"))
leaf_node = [
{
"documents": [markdown_path.read_text(encoding="utf-8")],
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 93fae83

Please sign in to comment.