Exemplo n.º 1
0
 def test_non_hashes(self):
     """Tests that False is returned for non hashes."""
     self.assertFalse(libfuzzer.is_sha1_hash(''))
     self.assertFalse(libfuzzer.is_sha1_hash('z' * 40))
     self.assertFalse(libfuzzer.is_sha1_hash('a' * 50))
     fake_hash = str('z' + ARBITRARY_SHA1_HASH[1:])
     self.assertFalse(libfuzzer.is_sha1_hash(fake_hash))
Exemplo n.º 2
0
 def test_hash(self):
     """Tests that False is returned for a real hash."""
     self.assertTrue(libfuzzer.is_sha1_hash(ARBITRARY_SHA1_HASH))