示例#1
0
 def test__get_hash_object(self, hashlib_mock):
     algorithms_available = ("md5", "sha1", "sha224", "sha256", "sha384", "sha512")
     hashlib_mock.algorithms_guaranteed = algorithms_available
     hashlib_mock.algorithms = algorithms_available
     # | WHEN |
     utils._get_hash_object("md5")
     utils._get_hash_object("sha1")
     utils._get_hash_object("sha224")
     utils._get_hash_object("sha256")
     utils._get_hash_object("sha384")
     utils._get_hash_object("sha512")
     # | THEN |
     calls = [
         mock.call.md5(),
         mock.call.sha1(),
         mock.call.sha224(),
         mock.call.sha256(),
         mock.call.sha384(),
         mock.call.sha512(),
     ]
     hashlib_mock.assert_has_calls(calls)
示例#2
0
 def test__get_hash_object(self, hashlib_mock):
     algorithms_available = ('md5', 'sha1', 'sha224', 'sha256', 'sha384',
                             'sha512')
     hashlib_mock.algorithms_guaranteed = algorithms_available
     hashlib_mock.algorithms = algorithms_available
     # | WHEN |
     utils._get_hash_object('md5')
     utils._get_hash_object('sha1')
     utils._get_hash_object('sha224')
     utils._get_hash_object('sha256')
     utils._get_hash_object('sha384')
     utils._get_hash_object('sha512')
     # | THEN |
     calls = [
         mock.call.md5(),
         mock.call.sha1(),
         mock.call.sha224(),
         mock.call.sha256(),
         mock.call.sha384(),
         mock.call.sha512()
     ]
     hashlib_mock.assert_has_calls(calls)
示例#3
0
 def test__get_hash_object(self, hashlib_mock):
     algorithms_available = ('md5', 'sha1', 'sha224',
                             'sha256', 'sha384', 'sha512')
     hashlib_mock.algorithms_guaranteed = algorithms_available
     hashlib_mock.algorithms = algorithms_available
     # | WHEN |
     utils._get_hash_object('md5')
     utils._get_hash_object('sha1')
     utils._get_hash_object('sha224')
     utils._get_hash_object('sha256')
     utils._get_hash_object('sha384')
     utils._get_hash_object('sha512')
     # | THEN |
     calls = [mock.call.md5(), mock.call.sha1(), mock.call.sha224(),
              mock.call.sha256(), mock.call.sha384(), mock.call.sha512()]
     hashlib_mock.assert_has_calls(calls)