chg: [style] Reformated with black.

This commit is contained in:
Cédric Bonhomme 2021-11-24 09:16:05 +01:00
parent 891051f77b
commit a1213a9163
No known key found for this signature in database
GPG key ID: A1CB94DE57B7A70D
13 changed files with 275 additions and 184 deletions

View file

@ -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=""
)

View file

@ -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)

View file

@ -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")