示例#1
0
文件: test_sethash.py 项目: F3DS/f3ds
 def testSetHashPassingAlgorithmMd5(self):
     'Test passing the md5 algorithm.'
     expected = hashlib.md5()
     actual = sethash.set_hash_function('md5')()
     self.assertIsInstance(actual, type(expected))
示例#2
0
文件: test_sethash.py 项目: F3DS/f3ds
 def testSetHashConfigValueNotSupported(self):
     'Test using the default hasher when the configured value is not supported.'
     setConfigValue(self.setting, 'blowfish')
     expected = hashlib.sha256()
     actual = sethash.set_hash_function()()
     self.assertIsInstance(actual, type(expected))
示例#3
0
文件: test_sethash.py 项目: F3DS/f3ds
 def testSetHashPassingAlgorithmSha1(self):
     'Test passing the sha1 algorithm.'
     expected = hashlib.sha1()
     actual = sethash.set_hash_function('sha1')()
     self.assertIsInstance(actual, type(expected))
示例#4
0
文件: test_sethash.py 项目: F3DS/f3ds
 def testSetHashConfigSha512(self):
     'Test using the default hasher from config file (sha512).'
     setConfigValue(self.setting, 'sha512')
     expected = hashlib.sha512()
     actual = sethash.set_hash_function()()
     self.assertIsInstance(actual, type(expected))