@@ -39,6 +39,8 @@ def wrapper(*args, **kwargs):
3939
4040class TestVectorsTestCase (unittest .TestCase ):
4141
42+ # TODO: RUSTPYTHON
43+ @unittest .expectedFailure
4244 def assert_hmac_internals (
4345 self , h , digest , hashname , digest_size , block_size
4446 ):
@@ -48,6 +50,8 @@ def assert_hmac_internals(
4850 self .assertEqual (h .digest_size , digest_size )
4951 self .assertEqual (h .block_size , block_size )
5052
53+ # TODO: RUSTPYTHON
54+ @unittest .expectedFailure
5155 def assert_hmac (
5256 self , key , data , digest , hashfunc , hashname , digest_size , block_size
5357 ):
@@ -122,6 +126,8 @@ def assert_hmac(
122126 h , digest , hashname , digest_size , block_size
123127 )
124128
129+ # TODO: RUSTPYTHON
130+ @unittest .expectedFailure
125131 @hashlib_helper .requires_hashdigest ('md5' , openssl = True )
126132 def test_md5_vectors (self ):
127133 # Test the HMAC module against test vectors from the RFC.
@@ -164,6 +170,8 @@ def md5test(key, data, digest):
164170 b"and Larger Than One Block-Size Data" ),
165171 "6f630fad67cda0ee1fb1f562db3aa53e" )
166172
173+ # TODO: RUSTPYTHON
174+ @unittest .expectedFailure
167175 @hashlib_helper .requires_hashdigest ('sha1' , openssl = True )
168176 def test_sha_vectors (self ):
169177 def shatest (key , data , digest ):
@@ -323,18 +331,26 @@ def hmactest(key, data, hexdigests):
323331 '134676fb6de0446065c97440fa8c6a58' ,
324332 })
325333
334+ # TODO: RUSTPYTHON
335+ @unittest .expectedFailure
326336 @hashlib_helper .requires_hashdigest ('sha224' , openssl = True )
327337 def test_sha224_rfc4231 (self ):
328338 self ._rfc4231_test_cases (hashlib .sha224 , 'sha224' , 28 , 64 )
329339
340+ # TODO: RUSTPYTHON
341+ @unittest .expectedFailure
330342 @hashlib_helper .requires_hashdigest ('sha256' , openssl = True )
331343 def test_sha256_rfc4231 (self ):
332344 self ._rfc4231_test_cases (hashlib .sha256 , 'sha256' , 32 , 64 )
333345
346+ # TODO: RUSTPYTHON
347+ @unittest .expectedFailure
334348 @hashlib_helper .requires_hashdigest ('sha384' , openssl = True )
335349 def test_sha384_rfc4231 (self ):
336350 self ._rfc4231_test_cases (hashlib .sha384 , 'sha384' , 48 , 128 )
337351
352+ # TODO: RUSTPYTHON
353+ @unittest .expectedFailure
338354 @hashlib_helper .requires_hashdigest ('sha512' , openssl = True )
339355 def test_sha512_rfc4231 (self ):
340356 self ._rfc4231_test_cases (hashlib .sha512 , 'sha512' , 64 , 128 )
@@ -380,6 +396,8 @@ class ConstructorTestCase(unittest.TestCase):
380396 "6c845b47f52b3b47f6590c502db7825aad757bf4fadc8fa972f7cd2e76a5bdeb"
381397 )
382398
399+ # TODO: RUSTPYTHON
400+ @unittest .expectedFailure
383401 @hashlib_helper .requires_hashdigest ('sha256' )
384402 def test_normal (self ):
385403 # Standard constructor call.
@@ -402,6 +420,8 @@ def test_dot_new_with_str_key(self):
402420 with self .assertRaises (TypeError ):
403421 h = hmac .new ("key" , digestmod = 'sha256' )
404422
423+ # TODO: RUSTPYTHON
424+ @unittest .expectedFailure
405425 @hashlib_helper .requires_hashdigest ('sha256' )
406426 def test_withtext (self ):
407427 # Constructor call with text.
@@ -411,6 +431,8 @@ def test_withtext(self):
411431 self .fail ("Constructor call with text argument raised exception." )
412432 self .assertEqual (h .hexdigest (), self .expected )
413433
434+ # TODO: RUSTPYTHON
435+ @unittest .expectedFailure
414436 @hashlib_helper .requires_hashdigest ('sha256' )
415437 def test_with_bytearray (self ):
416438 try :
@@ -420,6 +442,8 @@ def test_with_bytearray(self):
420442 self .fail ("Constructor call with bytearray arguments raised exception." )
421443 self .assertEqual (h .hexdigest (), self .expected )
422444
445+ # TODO: RUSTPYTHON
446+ @unittest .expectedFailure
423447 @hashlib_helper .requires_hashdigest ('sha256' )
424448 def test_with_memoryview_msg (self ):
425449 try :
@@ -428,6 +452,8 @@ def test_with_memoryview_msg(self):
428452 self .fail ("Constructor call with memoryview msg raised exception." )
429453 self .assertEqual (h .hexdigest (), self .expected )
430454
455+ # TODO: RUSTPYTHON
456+ @unittest .expectedFailure
431457 @hashlib_helper .requires_hashdigest ('sha256' )
432458 def test_withmodule (self ):
433459 # Constructor call with text and digest module.
@@ -436,13 +462,17 @@ def test_withmodule(self):
436462 except Exception :
437463 self .fail ("Constructor call with hashlib.sha256 raised exception." )
438464
465+ # TODO: RUSTPYTHON
466+ @unittest .expectedFailure
439467 @unittest .skipUnless (C_HMAC is not None , 'need _hashlib' )
440468 def test_internal_types (self ):
441469 # internal types like _hashlib.C_HMAC are not constructable
442470 check_disallow_instantiation (self , C_HMAC )
443471 with self .assertRaisesRegex (TypeError , "immutable type" ):
444472 C_HMAC .value = None
445473
474+ # TODO: RUSTPYTHON
475+ @unittest .expectedFailure
446476 @unittest .skipUnless (sha256_module is not None , 'need _sha256' )
447477 def test_with_sha256_module (self ):
448478 h = hmac .HMAC (b"key" , b"hash this!" , digestmod = sha256_module .sha256 )
@@ -455,6 +485,8 @@ def test_with_sha256_module(self):
455485
456486class SanityTestCase (unittest .TestCase ):
457487
488+ # TODO: RUSTPYTHON
489+ @unittest .expectedFailure
458490 @hashlib_helper .requires_hashdigest ('sha256' )
459491 def test_exercise_all_methods (self ):
460492 # Exercising all methods once.
@@ -496,6 +528,8 @@ def test_realcopy_old(self):
496528 "No real copy of the attribute 'outer'." )
497529 self .assertIs (h1 ._hmac , None )
498530
531+ # TODO: RUSTPYTHON
532+ @unittest .expectedFailure
499533 @unittest .skipIf (_hashopenssl is None , "test requires _hashopenssl" )
500534 @hashlib_helper .requires_hashdigest ('sha256' )
501535 def test_realcopy_hmac (self ):
@@ -504,6 +538,8 @@ def test_realcopy_hmac(self):
504538 h2 = h1 .copy ()
505539 self .assertTrue (id (h1 ._hmac ) != id (h2 ._hmac ))
506540
541+ # TODO: RUSTPYTHON
542+ @unittest .expectedFailure
507543 @hashlib_helper .requires_hashdigest ('sha256' )
508544 def test_equality (self ):
509545 # Testing if the copy has the same digests.
@@ -515,6 +551,8 @@ def test_equality(self):
515551 self .assertEqual (h1 .hexdigest (), h2 .hexdigest (),
516552 "Hexdigest of copy doesn't match original hexdigest." )
517553
554+ # TODO: RUSTPYTHON
555+ @unittest .expectedFailure
518556 @hashlib_helper .requires_hashdigest ('sha256' )
519557 def test_equality_new (self ):
520558 # Testing if the copy has the same digests with hmac.new().
@@ -532,6 +570,8 @@ def test_equality_new(self):
532570
533571class CompareDigestTestCase (unittest .TestCase ):
534572
573+ # TODO: RUSTPYTHON
574+ @unittest .expectedFailure
535575 def test_hmac_compare_digest (self ):
536576 self ._test_compare_digest (hmac .compare_digest )
537577 if openssl_compare_digest is not None :
@@ -542,6 +582,8 @@ def test_hmac_compare_digest(self):
542582 def test_operator_compare_digest (self ):
543583 self ._test_compare_digest (operator_compare_digest )
544584
585+ # TODO: RUSTPYTHON
586+ @unittest .expectedFailure
545587 @unittest .skipIf (openssl_compare_digest is None , "test requires _hashlib" )
546588 def test_openssl_compare_digest (self ):
547589 self ._test_compare_digest (openssl_compare_digest )
0 commit comments