예제 #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, '')