def test_hide_reveal_secret_string_full_depth(self): secret = "I am a tomato!" * 145 save_img, out_key, usage = snt.hide(secret, self.secret_image, depth=8) decrypted_secret = snt.reveal(out_key, save_img) self.assertTrue(secret == decrypted_secret)
def test_key_format_exception(self): secret = "I am a tomato!" save_img, out_key, usage = snt.hide(secret, self.source_image) out_key_modified = out_key + ";1234;1234" with self.assertRaises(snt.KeyFormatException): snt.reveal(out_key_modified, save_img)
def test_hide_reveal_secret_string_color(self): secret = "Colors are cool!" save_img, out_key, usage = snt.hide(secret, self.color_image) decrypted_secret = snt.reveal(out_key, save_img) self.assertTrue(secret == decrypted_secret)
def test_invalid_key_exception(self): secret = "I am a potato!" save_img, out_key, _ = snt.hide(secret, self.source_image) with self.assertRaises(snt.InvalidKeyException): snt.reveal("1234;1234;1234", save_img)
def test_hide_reveal_secret_unicode_string(self): secret = "🦥 eat 🍅!" save_img, out_key, usage = snt.hide(secret, self.source_image) decrypted_secret = snt.reveal(out_key, save_img) self.assertTrue(secret == decrypted_secret)