Skip to content

Commit e88a616

Browse files
committed
fix test with inline content
1 parent 50bb20f commit e88a616

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/unit/indexing/input/test_csv_loader.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,20 @@ async def test_csv_loader_multiple_files():
5656
assert len(documents) == 4
5757

5858

59-
async def test_csv_loader_preserves_multiline_fields():
59+
async def test_csv_loader_preserves_multiline_fields(tmp_path):
6060
"""Multiline quoted CSV fields must retain their internal newlines."""
61+
csv_content = (
62+
'title,text\r\n'
63+
'"Post 1","Line one.\nLine two.\nLine three."\r\n'
64+
'"Post 2","Single line."\r\n'
65+
)
66+
(tmp_path / "input.csv").write_text(csv_content, encoding="utf-8", newline="")
6167
config = InputConfig(
6268
type=InputType.Csv,
6369
text_column="text",
6470
title_column="title",
6571
)
66-
storage = create_storage(
67-
StorageConfig(
68-
base_dir="tests/unit/indexing/input/data/multiline-csv",
69-
)
70-
)
72+
storage = create_storage(StorageConfig(base_dir=str(tmp_path)))
7173
reader = create_input_reader(config, storage)
7274
documents = await reader.read_files()
7375
assert len(documents) == 2

0 commit comments

Comments
 (0)