Added some unit tests for the 'slsb' module.

This commit is contained in:
Cédric Bonhomme 2016-04-12 23:21:26 +02:00
parent 96d01439ea
commit f47cf3ae51
No known key found for this signature in database
GPG key ID: A1CB94DE57B7A70D
4 changed files with 89 additions and 0 deletions

View file

@ -81,6 +81,7 @@ def hide(input_image_file, message):
index += 3
img.close()
return encoded
def reveal(input_image_file):
@ -110,7 +111,9 @@ def reveal(input_image_file):
pass
if len(bitab)-len(str(limit))-1 == limit :
img.close()
return "".join(bitab)[len(str(limit))+1:]
img.close()
return ""
def write(image, output_image_file):
@ -121,6 +124,8 @@ def write(image, output_image_file):
except Exception as e:
# If hide() returns an error (Too long message).
print(e)
finally:
image.close()
if __name__ == '__main__':
# Point of entry in execution mode.