mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-06-28 11:16:14 +02:00
Check if the generator is implemented in Stegano.
This commit is contained in:
parent
d850bbd8a0
commit
a0f6f24d7c
3 changed files with 13 additions and 5 deletions
|
@ -41,7 +41,6 @@ class TestLSBSet(unittest.TestCase):
|
|||
|
||||
def test_hide_and_reveal(self):
|
||||
messages_to_hide = ["a", "foo", "Hello World!", ":Python:"]
|
||||
|
||||
for message in messages_to_hide:
|
||||
secret = lsbset.hide("./tests/sample-files/Lenna.png", message,
|
||||
"eratosthenes")
|
||||
|
@ -53,7 +52,6 @@ class TestLSBSet(unittest.TestCase):
|
|||
|
||||
def test_hide_and_reveal_with_bad_generator(self):
|
||||
message_to_hide = "Hello World!"
|
||||
|
||||
secret = lsbset.hide("./tests/sample-files/Lenna.png", message_to_hide,
|
||||
"eratosthenes")
|
||||
secret.save("./image.png")
|
||||
|
@ -61,6 +59,12 @@ class TestLSBSet(unittest.TestCase):
|
|||
with self.assertRaises(IndexError):
|
||||
clear_message = lsbset.reveal("./image.png", "identity")
|
||||
|
||||
def test_with_unknown_generator(self):
|
||||
message_to_hide = "Hello World!"
|
||||
with self.assertRaises(AttributeError):
|
||||
secret = lsbset.hide("./tests/sample-files/Lenna.png",
|
||||
message_to_hide, "eratosthene")
|
||||
|
||||
def tearDown(self):
|
||||
try:
|
||||
os.unlink("./image.png")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue