File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
tests/unit/indexing/input Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff 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.\n Line two.\n Line 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
You can’t perform that action at this time.
0 commit comments