mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-06-28 03:06:14 +02:00
Fix ResourceWarning: unclosed file, in tests
This commit is contained in:
parent
041a4ee05b
commit
f9619a8e1c
2 changed files with 10 additions and 10 deletions
|
@ -86,12 +86,11 @@ class TestEXIFHeader(unittest.TestCase):
|
|||
def test_with_bytes(self):
|
||||
outputBytes = io.BytesIO()
|
||||
message = b"Secret"
|
||||
exifHeader.hide(open("./tests/sample-files/20160505T130442.jpg", 'rb'),
|
||||
outputBytes,
|
||||
secret_message=message)
|
||||
with open("./tests/sample-files/20160505T130442.jpg", 'rb') as f:
|
||||
exifHeader.hide(f, outputBytes, secret_message=message)
|
||||
|
||||
clear_message = exifHeader.reveal(outputBytes)
|
||||
self.assertEqual(message, clear_message)
|
||||
clear_message = exifHeader.reveal(outputBytes)
|
||||
self.assertEqual(message, clear_message)
|
||||
|
||||
def tearDown(self):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue