19
19
20
20
class VersionTestCase (unittest .TestCase ):
21
21
22
+ # TODO: RUSTPYTHON
23
+ @unittest .expectedFailure
22
24
def test_library_version (self ):
23
25
# Test that the major version of the actual library in use matches the
24
26
# major version that we were compiled against. We can't guarantee that
@@ -29,6 +31,8 @@ def test_library_version(self):
29
31
30
32
31
33
class ChecksumTestCase (unittest .TestCase ):
34
+ # TODO: RUSTPYTHON
35
+ @unittest .expectedFailure
32
36
# checksum test cases
33
37
def test_crc32start (self ):
34
38
self .assertEqual (zlib .crc32 (b"" ), zlib .crc32 (b"" , 0 ))
@@ -39,6 +43,8 @@ def test_crc32empty(self):
39
43
self .assertEqual (zlib .crc32 (b"" , 1 ), 1 )
40
44
self .assertEqual (zlib .crc32 (b"" , 432 ), 432 )
41
45
46
+ # TODO: RUSTPYTHON
47
+ @unittest .expectedFailure
42
48
def test_adler32start (self ):
43
49
self .assertEqual (zlib .adler32 (b"" ), zlib .adler32 (b"" , 1 ))
44
50
self .assertTrue (zlib .adler32 (b"abc" , 0xffffffff ))
@@ -102,13 +108,15 @@ def test_badargs(self):
102
108
self .assertRaises (TypeError , zlib .compress , arg )
103
109
self .assertRaises (TypeError , zlib .decompress , arg )
104
110
111
+ @unittest .skip ('TODO: RUSTPYTHON' )
105
112
def test_badcompressobj (self ):
106
113
# verify failure on building compress object with bad params
107
114
self .assertRaises (ValueError , zlib .compressobj , 1 , zlib .DEFLATED , 0 )
108
115
# specifying total bits too large causes an error
109
116
self .assertRaises (ValueError ,
110
117
zlib .compressobj , 1 , zlib .DEFLATED , zlib .MAX_WBITS + 1 )
111
118
119
+ @unittest .skip ('TODO: RUSTPYTHON' )
112
120
def test_baddecompressobj (self ):
113
121
# verify failure on building decompress object with bad params
114
122
self .assertRaises (ValueError , zlib .decompressobj , - 1 )
@@ -165,6 +173,8 @@ def test_speech(self):
165
173
x = zlib .compress (HAMLET_SCENE )
166
174
self .assertEqual (zlib .decompress (x ), HAMLET_SCENE )
167
175
176
+ # TODO: RUSTPYTHON
177
+ @unittest .expectedFailure
168
178
def test_keywords (self ):
169
179
x = zlib .compress (HAMLET_SCENE , level = 3 )
170
180
self .assertEqual (zlib .decompress (x ), HAMLET_SCENE )
@@ -175,6 +185,8 @@ def test_keywords(self):
175
185
bufsize = zlib .DEF_BUF_SIZE ),
176
186
HAMLET_SCENE )
177
187
188
+ # TODO: RUSTPYTHON
189
+ @unittest .expectedFailure
178
190
def test_speech128 (self ):
179
191
# compress more data
180
192
data = HAMLET_SCENE * 128
@@ -183,6 +195,8 @@ def test_speech128(self):
183
195
for ob in x , bytearray (x ):
184
196
self .assertEqual (zlib .decompress (ob ), data )
185
197
198
+ # TODO: RUSTPYTHON
199
+ @unittest .expectedFailure
186
200
def test_incomplete_stream (self ):
187
201
# A useful error message is given
188
202
x = zlib .compress (HAMLET_SCENE )
@@ -201,13 +215,17 @@ def test_big_compress_buffer(self, size):
201
215
def test_big_decompress_buffer (self , size ):
202
216
self .check_big_decompress_buffer (size , zlib .decompress )
203
217
218
+ # TODO: RUSTPYTHON
219
+ @unittest .expectedFailure
204
220
@bigmemtest (size = _4G , memuse = 1 )
205
221
def test_large_bufsize (self , size ):
206
222
# Test decompress(bufsize) parameter greater than the internal limit
207
223
data = HAMLET_SCENE * 10
208
224
compressed = zlib .compress (data , 1 )
209
225
self .assertEqual (zlib .decompress (compressed , 15 , size ), data )
210
226
227
+ # TODO: RUSTPYTHON
228
+ @unittest .expectedFailure
211
229
def test_custom_bufsize (self ):
212
230
data = HAMLET_SCENE * 10
213
231
compressed = zlib .compress (data , 1 )
@@ -225,6 +243,8 @@ def test_64bit_compress(self, size):
225
243
226
244
227
245
class CompressObjectTestCase (BaseCompressTestCase , unittest .TestCase ):
246
+ # TODO: RUSTPYTHON
247
+ @unittest .expectedFailure
228
248
# Test compression object
229
249
def test_pair (self ):
230
250
# straightforward compress/decompress objects
@@ -245,6 +265,8 @@ def test_pair(self):
245
265
self .assertIsInstance (dco .unconsumed_tail , bytes )
246
266
self .assertIsInstance (dco .unused_data , bytes )
247
267
268
+ # TODO: RUSTPYTHON
269
+ @unittest .expectedFailure
248
270
def test_keywords (self ):
249
271
level = 2
250
272
method = zlib .DEFLATED
@@ -266,6 +288,8 @@ def test_keywords(self):
266
288
y = do .decompress (x , max_length = len (HAMLET_SCENE )) + do .flush ()
267
289
self .assertEqual (HAMLET_SCENE , y )
268
290
291
+ # TODO: RUSTPYTHON
292
+ @unittest .expectedFailure
269
293
def test_compressoptions (self ):
270
294
# specify lots of options to compressobj()
271
295
level = 2
@@ -281,6 +305,7 @@ def test_compressoptions(self):
281
305
y2 = dco .flush ()
282
306
self .assertEqual (HAMLET_SCENE , y1 + y2 )
283
307
308
+ @unittest .skip ('TODO: RUSTPYTHON' )
284
309
def test_compressincremental (self ):
285
310
# compress object in steps, decompress object as one-shot
286
311
data = HAMLET_SCENE * 128
@@ -296,6 +321,8 @@ def test_compressincremental(self):
296
321
y2 = dco .flush ()
297
322
self .assertEqual (data , y1 + y2 )
298
323
324
+ # TODO: RUSTPYTHON
325
+ @unittest .expectedFailure
299
326
def test_decompinc (self , flush = False , source = None , cx = 256 , dcx = 64 ):
300
327
# compress object in steps, decompress object in steps
301
328
source = source or HAMLET_SCENE
@@ -337,9 +364,13 @@ def test_decompinc(self, flush=False, source=None, cx=256, dcx=64):
337
364
self .assertEqual (data , b'' .join (bufs ))
338
365
# Failure means: "decompressobj with init options failed"
339
366
367
+ # TODO: RUSTPYTHON
368
+ @unittest .expectedFailure
340
369
def test_decompincflush (self ):
341
370
self .test_decompinc (flush = True )
342
371
372
+ # TODO: RUSTPYTHON
373
+ @unittest .expectedFailure
343
374
def test_decompimax (self , source = None , cx = 256 , dcx = 64 ):
344
375
# compress in steps, decompress in length-restricted steps
345
376
source = source or HAMLET_SCENE
@@ -367,6 +398,8 @@ def test_decompimax(self, source=None, cx=256, dcx=64):
367
398
bufs .append (dco .flush ())
368
399
self .assertEqual (data , b'' .join (bufs ), 'Wrong data retrieved' )
369
400
401
+ # TODO: RUSTPYTHON
402
+ @unittest .expectedFailure
370
403
def test_decompressmaxlen (self , flush = False ):
371
404
# Check a decompression object with max_length specified
372
405
data = HAMLET_SCENE * 128
@@ -399,15 +432,20 @@ def test_decompressmaxlen(self, flush=False):
399
432
bufs .append (chunk )
400
433
self .assertEqual (data , b'' .join (bufs ), 'Wrong data retrieved' )
401
434
435
+ # TODO: RUSTPYTHON
436
+ @unittest .expectedFailure
402
437
def test_decompressmaxlenflush (self ):
403
438
self .test_decompressmaxlen (flush = True )
404
439
440
+ # TODO: RUSTPYTHON
441
+ @unittest .expectedFailure
405
442
def test_maxlenmisc (self ):
406
443
# Misc tests of max_length
407
444
dco = zlib .decompressobj ()
408
445
self .assertRaises (ValueError , dco .decompress , b"" , - 1 )
409
446
self .assertEqual (b'' , dco .unconsumed_tail )
410
447
448
+ @unittest .skip ('TODO: RUSTPYTHON' )
411
449
def test_maxlen_large (self ):
412
450
# Sizes up to sys.maxsize should be accepted, although zlib is
413
451
# internally limited to expressing sizes with unsigned int
@@ -417,6 +455,8 @@ def test_maxlen_large(self):
417
455
dco = zlib .decompressobj ()
418
456
self .assertEqual (dco .decompress (compressed , sys .maxsize ), data )
419
457
458
+ # TODO: RUSTPYTHON
459
+ @unittest .expectedFailure
420
460
def test_maxlen_custom (self ):
421
461
data = HAMLET_SCENE * 10
422
462
compressed = zlib .compress (data , 1 )
@@ -432,6 +472,8 @@ def test_clear_unconsumed_tail(self):
432
472
ddata += dco .decompress (dco .unconsumed_tail )
433
473
self .assertEqual (dco .unconsumed_tail , b"" )
434
474
475
+ # TODO: RUSTPYTHON
476
+ @unittest .expectedFailure
435
477
def test_flushes (self ):
436
478
# Test flush() with the various options, using all the
437
479
# different levels in order to provide more variations.
@@ -498,6 +540,7 @@ def test_odd_flush(self):
498
540
# if decompressed data is different from the input data, choke.
499
541
self .assertEqual (expanded , data , "17K random source doesn't match" )
500
542
543
+ @unittest .skip ('TODO: RUSTPYTHON' )
501
544
def test_empty_flush (self ):
502
545
# Test that calling .flush() on unused objects works.
503
546
# (Bug #1083110 -- calling .flush() on decompress objects
@@ -508,6 +551,8 @@ def test_empty_flush(self):
508
551
dco = zlib .decompressobj ()
509
552
self .assertEqual (dco .flush (), b"" ) # Returns nothing
510
553
554
+ # TODO: RUSTPYTHON
555
+ @unittest .expectedFailure
511
556
def test_dictionary (self ):
512
557
h = HAMLET_SCENE
513
558
# Build a simulated dictionary out of the words in HAMLET.
@@ -524,6 +569,8 @@ def test_dictionary(self):
524
569
dco = zlib .decompressobj ()
525
570
self .assertRaises (zlib .error , dco .decompress , cd )
526
571
572
+ # TODO: RUSTPYTHON
573
+ @unittest .expectedFailure
527
574
def test_dictionary_streaming (self ):
528
575
# This simulates the reuse of a compressor object for compressing
529
576
# several separate data streams.
@@ -537,6 +584,8 @@ def test_dictionary_streaming(self):
537
584
self .assertEqual (do .decompress (d1 ), piece [100 :])
538
585
self .assertEqual (do .decompress (d2 ), piece [:- 100 ])
539
586
587
+ # TODO: RUSTPYTHON
588
+ @unittest .expectedFailure
540
589
def test_decompress_incomplete_stream (self ):
541
590
# This is 'foo', deflated
542
591
x = b'x\x9c K\xcb \xcf \x07 \x00 \x02 \x82 \x01 E'
@@ -550,6 +599,8 @@ def test_decompress_incomplete_stream(self):
550
599
y += dco .flush ()
551
600
self .assertEqual (y , b'foo' )
552
601
602
+ # TODO: RUSTPYTHON
603
+ @unittest .expectedFailure
553
604
def test_decompress_eof (self ):
554
605
x = b'x\x9c K\xcb \xcf \x07 \x00 \x02 \x82 \x01 E' # 'foo'
555
606
dco = zlib .decompressobj ()
@@ -561,6 +612,7 @@ def test_decompress_eof(self):
561
612
dco .flush ()
562
613
self .assertTrue (dco .eof )
563
614
615
+ @unittest .skip ('TODO: RUSTPYTHON' )
564
616
def test_decompress_eof_incomplete_stream (self ):
565
617
x = b'x\x9c K\xcb \xcf \x07 \x00 \x02 \x82 \x01 E' # 'foo'
566
618
dco = zlib .decompressobj ()
@@ -570,6 +622,8 @@ def test_decompress_eof_incomplete_stream(self):
570
622
dco .flush ()
571
623
self .assertFalse (dco .eof )
572
624
625
+ # TODO: RUSTPYTHON
626
+ @unittest .expectedFailure
573
627
def test_decompress_unused_data (self ):
574
628
# Repeated calls to decompress() after EOF should accumulate data in
575
629
# dco.unused_data, instead of just storing the arg to the last call.
@@ -596,6 +650,8 @@ def test_decompress_unused_data(self):
596
650
self .assertEqual (dco .unconsumed_tail , b'' )
597
651
self .assertEqual (dco .unused_data , remainder )
598
652
653
+ # TODO: RUSTPYTHON
654
+ @unittest .expectedFailure
599
655
# issue27164
600
656
def test_decompress_raw_with_dictionary (self ):
601
657
zdict = b'abcdefghijklmnopqrstuvwxyz'
@@ -605,6 +661,7 @@ def test_decompress_raw_with_dictionary(self):
605
661
uncomp = dco .decompress (comp ) + dco .flush ()
606
662
self .assertEqual (zdict , uncomp )
607
663
664
+ @unittest .skip ('TODO: RUSTPYTHON' )
608
665
def test_flush_with_freed_input (self ):
609
666
# Issue #16411: decompressor accesses input to last decompress() call
610
667
# in flush(), even if this object has been freed in the meanwhile.
@@ -617,6 +674,7 @@ def test_flush_with_freed_input(self):
617
674
data = zlib .compress (input2 )
618
675
self .assertEqual (dco .flush (), input1 [1 :])
619
676
677
+ @unittest .skip ('TODO: RUSTPYTHON' )
620
678
@bigmemtest (size = _4G , memuse = 1 )
621
679
def test_flush_large_length (self , size ):
622
680
# Test flush(length) parameter greater than internal limit UINT_MAX
@@ -626,6 +684,7 @@ def test_flush_large_length(self, size):
626
684
dco .decompress (data , 1 )
627
685
self .assertEqual (dco .flush (size ), input [1 :])
628
686
687
+ @unittest .skip ('TODO: RUSTPYTHON' )
629
688
def test_flush_custom_length (self ):
630
689
input = HAMLET_SCENE * 10
631
690
data = zlib .compress (input , 1 )
@@ -715,18 +774,21 @@ def test_decompresspickle(self):
715
774
716
775
# Memory use of the following functions takes into account overallocation
717
776
777
+ @unittest .skip ('TODO: RUSTPYTHON' )
718
778
@bigmemtest (size = _1G + 1024 * 1024 , memuse = 3 )
719
779
def test_big_compress_buffer (self , size ):
720
780
c = zlib .compressobj (1 )
721
781
compress = lambda s : c .compress (s ) + c .flush ()
722
782
self .check_big_compress_buffer (size , compress )
723
783
784
+ @unittest .skip ('TODO: RUSTPYTHON' )
724
785
@bigmemtest (size = _1G + 1024 * 1024 , memuse = 2 )
725
786
def test_big_decompress_buffer (self , size ):
726
787
d = zlib .decompressobj ()
727
788
decompress = lambda s : d .decompress (s ) + d .flush ()
728
789
self .check_big_decompress_buffer (size , decompress )
729
790
791
+ @unittest .skip ('TODO: RUSTPYTHON' )
730
792
@unittest .skipUnless (sys .maxsize > 2 ** 32 , 'requires 64bit platform' )
731
793
@bigmemtest (size = _4G + 100 , memuse = 4 )
732
794
def test_64bit_compress (self , size ):
@@ -740,6 +802,7 @@ def test_64bit_compress(self, size):
740
802
finally :
741
803
comp = uncomp = data = None
742
804
805
+ @unittest .skip ('TODO: RUSTPYTHON' )
743
806
@unittest .skipUnless (sys .maxsize > 2 ** 32 , 'requires 64bit platform' )
744
807
@bigmemtest (size = _4G + 100 , memuse = 3 )
745
808
def test_large_unused_data (self , size ):
@@ -754,6 +817,7 @@ def test_large_unused_data(self, size):
754
817
finally :
755
818
unused = comp = do = None
756
819
820
+ @unittest .skip ('TODO: RUSTPYTHON' )
757
821
@unittest .skipUnless (sys .maxsize > 2 ** 32 , 'requires 64bit platform' )
758
822
@bigmemtest (size = _4G + 100 , memuse = 5 )
759
823
def test_large_unconsumed_tail (self , size ):
@@ -767,6 +831,8 @@ def test_large_unconsumed_tail(self, size):
767
831
finally :
768
832
comp = uncomp = data = None
769
833
834
+ # TODO: RUSTPYTHON
835
+ @unittest .expectedFailure
770
836
def test_wbits (self ):
771
837
# wbits=0 only supported since zlib v1.2.3.5
772
838
# Register "1.2.3" as "1.2.3.0"
0 commit comments