@@ -39,6 +39,8 @@ def wrapper(*args, **kwargs):
39
39
40
40
class TestVectorsTestCase (unittest .TestCase ):
41
41
42
+ # TODO: RUSTPYTHON
43
+ @unittest .expectedFailure
42
44
def assert_hmac_internals (
43
45
self , h , digest , hashname , digest_size , block_size
44
46
):
@@ -48,6 +50,8 @@ def assert_hmac_internals(
48
50
self .assertEqual (h .digest_size , digest_size )
49
51
self .assertEqual (h .block_size , block_size )
50
52
53
+ # TODO: RUSTPYTHON
54
+ @unittest .expectedFailure
51
55
def assert_hmac (
52
56
self , key , data , digest , hashfunc , hashname , digest_size , block_size
53
57
):
@@ -122,6 +126,8 @@ def assert_hmac(
122
126
h , digest , hashname , digest_size , block_size
123
127
)
124
128
129
+ # TODO: RUSTPYTHON
130
+ @unittest .expectedFailure
125
131
@hashlib_helper .requires_hashdigest ('md5' , openssl = True )
126
132
def test_md5_vectors (self ):
127
133
# Test the HMAC module against test vectors from the RFC.
@@ -164,6 +170,8 @@ def md5test(key, data, digest):
164
170
b"and Larger Than One Block-Size Data" ),
165
171
"6f630fad67cda0ee1fb1f562db3aa53e" )
166
172
173
+ # TODO: RUSTPYTHON
174
+ @unittest .expectedFailure
167
175
@hashlib_helper .requires_hashdigest ('sha1' , openssl = True )
168
176
def test_sha_vectors (self ):
169
177
def shatest (key , data , digest ):
@@ -323,18 +331,26 @@ def hmactest(key, data, hexdigests):
323
331
'134676fb6de0446065c97440fa8c6a58' ,
324
332
})
325
333
334
+ # TODO: RUSTPYTHON
335
+ @unittest .expectedFailure
326
336
@hashlib_helper .requires_hashdigest ('sha224' , openssl = True )
327
337
def test_sha224_rfc4231 (self ):
328
338
self ._rfc4231_test_cases (hashlib .sha224 , 'sha224' , 28 , 64 )
329
339
340
+ # TODO: RUSTPYTHON
341
+ @unittest .expectedFailure
330
342
@hashlib_helper .requires_hashdigest ('sha256' , openssl = True )
331
343
def test_sha256_rfc4231 (self ):
332
344
self ._rfc4231_test_cases (hashlib .sha256 , 'sha256' , 32 , 64 )
333
345
346
+ # TODO: RUSTPYTHON
347
+ @unittest .expectedFailure
334
348
@hashlib_helper .requires_hashdigest ('sha384' , openssl = True )
335
349
def test_sha384_rfc4231 (self ):
336
350
self ._rfc4231_test_cases (hashlib .sha384 , 'sha384' , 48 , 128 )
337
351
352
+ # TODO: RUSTPYTHON
353
+ @unittest .expectedFailure
338
354
@hashlib_helper .requires_hashdigest ('sha512' , openssl = True )
339
355
def test_sha512_rfc4231 (self ):
340
356
self ._rfc4231_test_cases (hashlib .sha512 , 'sha512' , 64 , 128 )
@@ -380,6 +396,8 @@ class ConstructorTestCase(unittest.TestCase):
380
396
"6c845b47f52b3b47f6590c502db7825aad757bf4fadc8fa972f7cd2e76a5bdeb"
381
397
)
382
398
399
+ # TODO: RUSTPYTHON
400
+ @unittest .expectedFailure
383
401
@hashlib_helper .requires_hashdigest ('sha256' )
384
402
def test_normal (self ):
385
403
# Standard constructor call.
@@ -402,6 +420,8 @@ def test_dot_new_with_str_key(self):
402
420
with self .assertRaises (TypeError ):
403
421
h = hmac .new ("key" , digestmod = 'sha256' )
404
422
423
+ # TODO: RUSTPYTHON
424
+ @unittest .expectedFailure
405
425
@hashlib_helper .requires_hashdigest ('sha256' )
406
426
def test_withtext (self ):
407
427
# Constructor call with text.
@@ -411,6 +431,8 @@ def test_withtext(self):
411
431
self .fail ("Constructor call with text argument raised exception." )
412
432
self .assertEqual (h .hexdigest (), self .expected )
413
433
434
+ # TODO: RUSTPYTHON
435
+ @unittest .expectedFailure
414
436
@hashlib_helper .requires_hashdigest ('sha256' )
415
437
def test_with_bytearray (self ):
416
438
try :
@@ -420,6 +442,8 @@ def test_with_bytearray(self):
420
442
self .fail ("Constructor call with bytearray arguments raised exception." )
421
443
self .assertEqual (h .hexdigest (), self .expected )
422
444
445
+ # TODO: RUSTPYTHON
446
+ @unittest .expectedFailure
423
447
@hashlib_helper .requires_hashdigest ('sha256' )
424
448
def test_with_memoryview_msg (self ):
425
449
try :
@@ -428,6 +452,8 @@ def test_with_memoryview_msg(self):
428
452
self .fail ("Constructor call with memoryview msg raised exception." )
429
453
self .assertEqual (h .hexdigest (), self .expected )
430
454
455
+ # TODO: RUSTPYTHON
456
+ @unittest .expectedFailure
431
457
@hashlib_helper .requires_hashdigest ('sha256' )
432
458
def test_withmodule (self ):
433
459
# Constructor call with text and digest module.
@@ -436,13 +462,17 @@ def test_withmodule(self):
436
462
except Exception :
437
463
self .fail ("Constructor call with hashlib.sha256 raised exception." )
438
464
465
+ # TODO: RUSTPYTHON
466
+ @unittest .expectedFailure
439
467
@unittest .skipUnless (C_HMAC is not None , 'need _hashlib' )
440
468
def test_internal_types (self ):
441
469
# internal types like _hashlib.C_HMAC are not constructable
442
470
check_disallow_instantiation (self , C_HMAC )
443
471
with self .assertRaisesRegex (TypeError , "immutable type" ):
444
472
C_HMAC .value = None
445
473
474
+ # TODO: RUSTPYTHON
475
+ @unittest .expectedFailure
446
476
@unittest .skipUnless (sha256_module is not None , 'need _sha256' )
447
477
def test_with_sha256_module (self ):
448
478
h = hmac .HMAC (b"key" , b"hash this!" , digestmod = sha256_module .sha256 )
@@ -455,6 +485,8 @@ def test_with_sha256_module(self):
455
485
456
486
class SanityTestCase (unittest .TestCase ):
457
487
488
+ # TODO: RUSTPYTHON
489
+ @unittest .expectedFailure
458
490
@hashlib_helper .requires_hashdigest ('sha256' )
459
491
def test_exercise_all_methods (self ):
460
492
# Exercising all methods once.
@@ -496,6 +528,8 @@ def test_realcopy_old(self):
496
528
"No real copy of the attribute 'outer'." )
497
529
self .assertIs (h1 ._hmac , None )
498
530
531
+ # TODO: RUSTPYTHON
532
+ @unittest .expectedFailure
499
533
@unittest .skipIf (_hashopenssl is None , "test requires _hashopenssl" )
500
534
@hashlib_helper .requires_hashdigest ('sha256' )
501
535
def test_realcopy_hmac (self ):
@@ -504,6 +538,8 @@ def test_realcopy_hmac(self):
504
538
h2 = h1 .copy ()
505
539
self .assertTrue (id (h1 ._hmac ) != id (h2 ._hmac ))
506
540
541
+ # TODO: RUSTPYTHON
542
+ @unittest .expectedFailure
507
543
@hashlib_helper .requires_hashdigest ('sha256' )
508
544
def test_equality (self ):
509
545
# Testing if the copy has the same digests.
@@ -515,6 +551,8 @@ def test_equality(self):
515
551
self .assertEqual (h1 .hexdigest (), h2 .hexdigest (),
516
552
"Hexdigest of copy doesn't match original hexdigest." )
517
553
554
+ # TODO: RUSTPYTHON
555
+ @unittest .expectedFailure
518
556
@hashlib_helper .requires_hashdigest ('sha256' )
519
557
def test_equality_new (self ):
520
558
# Testing if the copy has the same digests with hmac.new().
@@ -532,6 +570,8 @@ def test_equality_new(self):
532
570
533
571
class CompareDigestTestCase (unittest .TestCase ):
534
572
573
+ # TODO: RUSTPYTHON
574
+ @unittest .expectedFailure
535
575
def test_hmac_compare_digest (self ):
536
576
self ._test_compare_digest (hmac .compare_digest )
537
577
if openssl_compare_digest is not None :
@@ -542,6 +582,8 @@ def test_hmac_compare_digest(self):
542
582
def test_operator_compare_digest (self ):
543
583
self ._test_compare_digest (operator_compare_digest )
544
584
585
+ # TODO: RUSTPYTHON
586
+ @unittest .expectedFailure
545
587
@unittest .skipIf (openssl_compare_digest is None , "test requires _hashlib" )
546
588
def test_openssl_compare_digest (self ):
547
589
self ._test_compare_digest (openssl_compare_digest )
0 commit comments