mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-06-28 03:06:14 +02:00
chg: [style] Reformated with black.
This commit is contained in:
parent
891051f77b
commit
a1213a9163
13 changed files with 275 additions and 184 deletions
|
@ -34,8 +34,7 @@ from stegano import exifHeader
|
|||
|
||||
class TestEXIFHeader(unittest.TestCase):
|
||||
def test_hide_empty_message(self):
|
||||
"""Test hiding the empty string.
|
||||
"""
|
||||
"""Test hiding the empty string."""
|
||||
secret = exifHeader.hide(
|
||||
"./tests/sample-files/20160505T130442.jpg", "./image.jpg", secret_message=""
|
||||
)
|
||||
|
|
|
@ -72,11 +72,15 @@ class TestLSBSet(unittest.TestCase):
|
|||
messages_to_hide = ["foo bar"]
|
||||
for message in messages_to_hide:
|
||||
secret = lsbset.hide(
|
||||
"./tests/sample-files/Lenna.png", message, generators.shi_tomashi("./tests/sample-files/Lenna.png")
|
||||
"./tests/sample-files/Lenna.png",
|
||||
message,
|
||||
generators.shi_tomashi("./tests/sample-files/Lenna.png"),
|
||||
)
|
||||
secret.save("./image.png")
|
||||
|
||||
clear_message = lsbset.reveal("./image.png", generators.shi_tomashi("./tests/sample-files/Lenna.png"))
|
||||
clear_message = lsbset.reveal(
|
||||
"./image.png", generators.shi_tomashi("./tests/sample-files/Lenna.png")
|
||||
)
|
||||
|
||||
self.assertEqual(message, clear_message)
|
||||
|
||||
|
|
|
@ -38,8 +38,7 @@ from PIL import Image, ImageChops
|
|||
|
||||
class TestSteganalysis(unittest.TestCase):
|
||||
def test_parity(self):
|
||||
"""Test stegano.steganalysis.parity
|
||||
"""
|
||||
"""Test stegano.steganalysis.parity"""
|
||||
text_file_to_hide = "./tests/sample-files/lorem_ipsum.txt"
|
||||
with open(text_file_to_hide) as f:
|
||||
message = f.read()
|
||||
|
@ -50,8 +49,7 @@ class TestSteganalysis(unittest.TestCase):
|
|||
self.assertTrue(diff is None)
|
||||
|
||||
def test_parity_rgba(self):
|
||||
""" Test that stegano.steganalysis.parity works with RGBA images
|
||||
"""
|
||||
"""Test that stegano.steganalysis.parity works with RGBA images"""
|
||||
img = Image.open("./tests/sample-files/transparent.png")
|
||||
analysis = parity.steganalyse(img)
|
||||
target = Image.open("./tests/expected-results/parity_rgba.png")
|
||||
|
@ -59,8 +57,7 @@ class TestSteganalysis(unittest.TestCase):
|
|||
self.assertTrue(diff is None)
|
||||
|
||||
def test_statistics(self):
|
||||
""" Test stegano.steganalysis.statistics
|
||||
"""
|
||||
"""Test stegano.steganalysis.statistics"""
|
||||
image = Image.open("./tests/sample-files/Lenna.png")
|
||||
stats = str(statistics.steganalyse(image)) + "\n"
|
||||
file = open("./tests/expected-results/statistics")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue