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))
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))
def tearDownModule(cls): 'Restore the algorithm setting' setConfigValue(cls.setting, cls.saved_algorithm)
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)
def setUpClass(cls): 'Save the current algorithm setting.' cls.saved_algorithm = setConfigValue(cls.setting, '')