Skip to content

Commit

Permalink
Merge pull request #356 from bbrowning/chunking_testing
Browse files Browse the repository at this point in the history
Consolidate test sample documents into one subdir
  • Loading branch information
mergify[bot] authored Nov 11, 2024
2 parents 119d309 + 93fae83 commit 9173237
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 9173237

Please sign in to comment.