mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-06-28 03:06:14 +02:00
Added steganalysis.statistics unit test
This commit is contained in:
parent
b054fc7a0c
commit
a060757f76
2 changed files with 12 additions and 1 deletions
|
@ -32,7 +32,7 @@ import unittest
|
|||
from unittest.mock import patch
|
||||
|
||||
from stegano import lsb
|
||||
from stegano.steganalysis import parity
|
||||
from stegano.steganalysis import parity, statistics
|
||||
from PIL import Image, ImageChops
|
||||
|
||||
|
||||
|
@ -59,6 +59,16 @@ class TestSteganalysis(unittest.TestCase):
|
|||
diff = ImageChops.difference(target, analysis).getbbox()
|
||||
self.assertTrue(diff is None)
|
||||
|
||||
def test_statistics(self):
|
||||
""" Test stegano.steganalysis.statistics
|
||||
"""
|
||||
image = Image.open("./tests/sample-files/Lenna.png")
|
||||
stats = str(statistics.steganalyse(image)) + '\n'
|
||||
file = open("./tests/expected-results/statistics")
|
||||
target = file.read()
|
||||
file.close()
|
||||
self.assertEqual(stats, target)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue