@@ -150,6 +150,8 @@ def _write_error_test(self, exc, fields, **kwargs):
150
150
fileobj .seek (0 )
151
151
self .assertEqual (fileobj .read (), '' )
152
152
153
+ # TODO: RUSTPYTHON ''\r\n to ""\r\n unsupported
154
+ @unittest .expectedFailure
153
155
def test_write_arg_valid (self ):
154
156
self ._write_error_test (csv .Error , None )
155
157
self ._write_test ((), '' )
@@ -175,6 +177,8 @@ def test_write_bigfield(self):
175
177
self ._write_test ([bigstring ,bigstring ], '%s,%s' % \
176
178
(bigstring , bigstring ))
177
179
180
+ # TODO: RUSTPYTHON quoting style check is unsupported
181
+ @unittest .expectedFailure
178
182
def test_write_quoting (self ):
179
183
self ._write_test (['a' ,1 ,'p,q' ], 'a,1,"p,q"' )
180
184
self ._write_error_test (csv .Error , ['a' ,1 ,'p,q' ],
@@ -192,6 +196,8 @@ def test_write_quoting(self):
192
196
self ._write_test (['a' ,'' ,None ,1 ], '"a","",,"1"' ,
193
197
quoting = csv .QUOTE_NOTNULL )
194
198
199
+ # TODO: RUSTPYTHON doublequote check is unsupported
200
+ @unittest .expectedFailure
195
201
def test_write_escape (self ):
196
202
self ._write_test (['a' ,1 ,'p,q' ], 'a,1,"p,q"' ,
197
203
escapechar = '\\ ' )
@@ -223,6 +229,8 @@ def test_write_escape(self):
223
229
self ._write_test (['C\\ ' , '6' , '7' , 'X"' ], 'C\\ \\ ,6,7,"X"""' ,
224
230
escapechar = '\\ ' , quoting = csv .QUOTE_MINIMAL )
225
231
232
+ # TODO: RUSTPYTHON lineterminator double char unsupported
233
+ @unittest .expectedFailure
226
234
def test_write_lineterminator (self ):
227
235
for lineterminator in '\r \n ' , '\n ' , '\r ' , '!@#' , '\0 ' :
228
236
with self .subTest (lineterminator = lineterminator ):
@@ -234,6 +242,8 @@ def test_write_lineterminator(self):
234
242
f'a,b{ lineterminator } '
235
243
f'1,2{ lineterminator } ' )
236
244
245
+ # TODO: RUSTPYTHON ''\r\n to ""\r\n unspported
246
+ @unittest .expectedFailure
237
247
def test_write_iterable (self ):
238
248
self ._write_test (iter (['a' , 1 , 'p,q' ]), 'a,1,"p,q"' )
239
249
self ._write_test (iter (['a' , 1 , None ]), 'a,1,' )
@@ -298,6 +308,8 @@ def _read_test(self, input, expect, **kwargs):
298
308
result = list (reader )
299
309
self .assertEqual (result , expect )
300
310
311
+ # TODO RUSTPYTHON strict mode is unsupported
312
+ @unittest .expectedFailure
301
313
def test_read_oddinputs (self ):
302
314
self ._read_test ([], [])
303
315
self ._read_test (['' ], [[]])
@@ -317,6 +329,8 @@ def test_read_eol(self):
317
329
self .assertRaises (csv .Error , self ._read_test , ['a,b\n c,d' ], [])
318
330
self .assertRaises (csv .Error , self ._read_test , ['a,b\r \n c,d' ], [])
319
331
332
+ # TODO RUSTPYTHON double quote umimplement
333
+ @unittest .expectedFailure
320
334
def test_read_eof (self ):
321
335
self ._read_test (['a,"' ], [['a' , '' ]])
322
336
self ._read_test (['"a' ], [['a' ]])
@@ -326,6 +340,8 @@ def test_read_eof(self):
326
340
self .assertRaises (csv .Error , self ._read_test ,
327
341
['^' ], [], escapechar = '^' , strict = True )
328
342
343
+ # TODO RUSTPYTHON
344
+ @unittest .expectedFailure
329
345
def test_read_nul (self ):
330
346
self ._read_test (['\0 ' ], [['\0 ' ]])
331
347
self ._read_test (['a,\0 b,c' ], [['a' , '\0 b' , 'c' ]])
@@ -338,6 +354,8 @@ def test_read_delimiter(self):
338
354
self ._read_test (['a;b;c' ], [['a' , 'b' , 'c' ]], delimiter = ';' )
339
355
self ._read_test (['a\0 b\0 c' ], [['a' , 'b' , 'c' ]], delimiter = '\0 ' )
340
356
357
+ # TODO RUSTPYTHON
358
+ @unittest .expectedFailure
341
359
def test_read_escape (self ):
342
360
self ._read_test (['a,\\ b,c' ], [['a' , 'b' , 'c' ]], escapechar = '\\ ' )
343
361
self ._read_test (['a,b\\ ,c' ], [['a' , 'b,c' ]], escapechar = '\\ ' )
@@ -350,6 +368,8 @@ def test_read_escape(self):
350
368
self ._read_test (['a,\\ b,c' ], [['a' , '\\ b' , 'c' ]], escapechar = None )
351
369
self ._read_test (['a,\\ b,c' ], [['a' , '\\ b' , 'c' ]])
352
370
371
+ # TODO RUSTPYTHON escapechar unsupported
372
+ @unittest .expectedFailure
353
373
def test_read_quoting (self ):
354
374
self ._read_test (['1,",3,",5' ], [['1' , ',3,' , '5' ]])
355
375
self ._read_test (['1,",3,",5' ], [['1' , '"' , '3' , '"' , '5' ]],
@@ -402,6 +422,8 @@ def test_read_linenum(self):
402
422
self .assertRaises (StopIteration , next , r )
403
423
self .assertEqual (r .line_num , 3 )
404
424
425
+ # TODO: RUSTPYTHON only '\r\n' unsupported
426
+ @unittest .expectedFailure
405
427
def test_roundtrip_quoteed_newlines (self ):
406
428
with TemporaryFile ("w+" , encoding = "utf-8" , newline = '' ) as fileobj :
407
429
writer = csv .writer (fileobj )
@@ -411,6 +433,8 @@ def test_roundtrip_quoteed_newlines(self):
411
433
for i , row in enumerate (csv .reader (fileobj )):
412
434
self .assertEqual (row , rows [i ])
413
435
436
+ # TODO: RUSTPYTHON only '\r\n' unsupported
437
+ @unittest .expectedFailure
414
438
def test_roundtrip_escaped_unquoted_newlines (self ):
415
439
with TemporaryFile ("w+" , encoding = "utf-8" , newline = '' ) as fileobj :
416
440
writer = csv .writer (fileobj ,quoting = csv .QUOTE_NONE ,escapechar = "\\ " )
@@ -512,6 +536,8 @@ def compare_dialect_123(self, expected, *writeargs, **kwwriteargs):
512
536
fileobj .seek (0 )
513
537
self .assertEqual (fileobj .read (), expected )
514
538
539
+ # TODO: RUSTPYTHON
F438
540
+ @unittest .expectedFailure
515
541
def test_dialect_apply (self ):
516
542
class testA (csv .excel ):
517
543
delimiter = "\t "
@@ -555,6 +581,8 @@ def test_copy(self):
555
581
dialect = csv .get_dialect (name )
556
582
self .assertRaises (TypeError , copy .copy , dialect )
557
583
584
+ # TODO: RUSTPYTHON
585
+ @unittest .expectedFailure
558
586
def test_pickle (self ):
559
587
for name in csv .list_dialects ():
560
588
dialect = csv .get_dialect (name )
@@ -641,6 +669,8 @@ def test_quoted_quote(self):
641
669
'"I see," said the blind man' ,
642
670
'as he picked up his hammer and saw' ]])
643
671
672
+ # Rustpython TODO
673
+ @unittest .expectedFailure
644
674
def test_quoted_nl (self ):
645
675
input = '''\
646
676
1,2,3,"""I see,""
@@ -681,15 +711,21 @@ class EscapedExcel(csv.excel):
681
711
class TestEscapedExcel (TestCsvBase ):
682
712
dialect = EscapedExcel ()
683
713
714
+ # TODO RUSTPYTHON
715
+ @unittest .expectedFailure
684
716
def test_escape_fieldsep (self ):
685
717
self .writerAssertEqual ([['abc,def' ]], 'abc\\ ,def\r \n ' )
686
718
719
+ # TODO RUSTPYTHON
720
+ @unittest .expectedFailure
687
721
def test_read_escape_fieldsep (self ):
688
722
self .readerAssertEqual ('abc\\ ,def\r \n ' , [['abc,def' ]])
689
723
690
724
class TestDialectUnix (TestCsvBase ):
691
725
dialect = 'unix'
692
726
727
+ # TODO RUSTPYTHON
728
+ @unittest .expectedFailure
693
729
def test_simple_writer (self ):
694
730
self .writerAssertEqual ([[1 , 'abc def' , 'abc' ]], '"1","abc def","abc"\n ' )
695
731
@@ -706,6 +742,8 @@ class TestQuotedEscapedExcel(TestCsvBase):
706
742
def test_write_escape_fieldsep (self ):
707
743
self .writerAssertEqual ([['abc,def' ]], '"abc,def"\r \n ' )
708
744
745
+ # TODO RUSTPYTHON
746
+ @unittest .expectedFailure
709
747
def test_read_escape_fieldsep (self ):
710
748
self .readerAssertEqual ('"abc\\ ,def"\r \n ' , [['abc,def' ]])
711
749
@@ -902,6 +940,8 @@ def test_read_multi(self):
902
940
"s1" : 'abc' ,
903
941
"s2" : 'def' })
904
942
943
+ # TODO RUSTPYTHON
944
+ @unittest .expectedFailure
905
945
def test_read_with_blanks (self ):
906
946
reader = csv .DictReader (["1,2,abc,4,5,6\r \n " ,"\r \n " ,
907
947
"1,2,abc,4,5,6\r \n " ],
0 commit comments