mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-06-28 03:06:14 +02:00
Updated tests.
This commit is contained in:
parent
c5b7df87f5
commit
ba3cde6112
2 changed files with 28 additions and 1 deletions
|
@ -132,7 +132,6 @@ class TestLSB(unittest.TestCase):
|
|||
messages_to_hide = ["a", "foo", "Hello World!", ":Python:"]
|
||||
|
||||
for message in messages_to_hide:
|
||||
message = "Hello World"
|
||||
outputBytes = io.BytesIO()
|
||||
with open("./tests/sample-files/20160505T130442.jpg", 'rb') as f:
|
||||
bytes_image = lsb.hide(f, message)
|
||||
|
@ -143,6 +142,19 @@ class TestLSB(unittest.TestCase):
|
|||
|
||||
self.assertEqual(message, clear_message)
|
||||
|
||||
def test_with_location_of_image_as_argument(self):
|
||||
messages_to_hide = ["Hello World!"]
|
||||
|
||||
for message in messages_to_hide:
|
||||
outputBytes = io.BytesIO()
|
||||
bytes_image = lsb.hide("./tests/sample-files/20160505T130442.jpg", message)
|
||||
bytes_image.save(outputBytes, "PNG")
|
||||
outputBytes.seek(0)
|
||||
|
||||
clear_message = lsb.reveal(outputBytes)
|
||||
|
||||
self.assertEqual(message, clear_message)
|
||||
|
||||
def tearDown(self):
|
||||
try:
|
||||
os.unlink("./image.png")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue