()
| 2140 | |
| 2141 | |
| 2142 | def test_write_eol(): |
| 2143 | t = pa.Table.from_arrays([[1, 2, 3], ["a", "b", "c"]], ["c1", "c2"]) |
| 2144 | buf = io.BytesIO() |
| 2145 | for write_options, res in [ |
| 2146 | (WriteOptions(), b'"c1","c2"\n1,"a"\n2,"b"\n3,"c"\n'), |
| 2147 | (WriteOptions(eol='\n'), b'"c1","c2"\n1,"a"\n2,"b"\n3,"c"\n'), |
| 2148 | (WriteOptions(eol='\r\n'), |
| 2149 | b'"c1","c2"\r\n1,"a"\r\n2,"b"\r\n3,"c"\r\n'), |
| 2150 | (WriteOptions(eol='*'), b'"c1","c2"*1,"a"*2,"b"*3,"c"*'), |
| 2151 | ]: |
| 2152 | with CSVWriter(buf, t.schema, write_options=write_options) as writer: |
| 2153 | writer.write_table(t) |
| 2154 | assert buf.getvalue() == res |
| 2155 | buf.seek(0) |
| 2156 | buf.truncate() |
| 2157 | |
| 2158 | |
| 2159 | def test_write_null_string(): |
nothing calls this directly
no test coverage detected