Beispiel #1
0
 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))
Beispiel #2
0
 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))
Beispiel #3
0
 def tearDownModule(cls):
     'Restore the algorithm setting'
     setConfigValue(cls.setting, cls.saved_algorithm)
Beispiel #4
0
 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)
Beispiel #5
0
 def setUpClass(cls):
     'Save the current algorithm setting.'
     cls.saved_algorithm = setConfigValue(cls.setting, '')