def testSetHashPassingAlgorithmMd5(self): 'Test passing the md5 algorithm.' expected = hashlib.md5() actual = sethash.set_hash_function('md5')() self.assertIsInstance(actual, type(expected))
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 testSetHashPassingAlgorithmSha1(self): 'Test passing the sha1 algorithm.' expected = hashlib.sha1() actual = sethash.set_hash_function('sha1')() 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))