示例#1
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))
示例#2
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))
示例#3
0
文件: test_sethash.py 项目: F3DS/f3ds
 def tearDownModule(cls):
     'Restore the algorithm setting'
     setConfigValue(cls.setting, cls.saved_algorithm)
示例#4
0
文件: test_sethash.py 项目: F3DS/f3ds
 def tearDown(self):
     'Reset the value of the configured algorithm.'
     # If this is not reset, and 'blowfish' is the
     # setting that remains, testUseHasher will fail.
     setConfigValue(self.setting, self.saved_algorithm)
示例#5
0
文件: test_sethash.py 项目: F3DS/f3ds
 def setUpClass(cls):
     'Save the current algorithm setting.'
     cls.saved_algorithm = setConfigValue(cls.setting, '')