mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-05 21:53:15 +03:00
Test dump()
This commit is contained in:
parent
a0aff1a87f
commit
35838da803
|
@ -51,6 +51,27 @@ class TestFileIptc(PillowTestCase):
|
||||||
# Assert
|
# Assert
|
||||||
self.assertEqual(ret, 97)
|
self.assertEqual(ret, 97)
|
||||||
|
|
||||||
|
def test_dump(self):
|
||||||
|
# Arrange
|
||||||
|
c = b"abc"
|
||||||
|
# Temporarily redirect stdout
|
||||||
|
try:
|
||||||
|
from cStringIO import StringIO
|
||||||
|
except ImportError:
|
||||||
|
from io import StringIO
|
||||||
|
import sys
|
||||||
|
old_stdout = sys.stdout
|
||||||
|
sys.stdout = mystdout = StringIO()
|
||||||
|
|
||||||
|
# Act
|
||||||
|
IptcImagePlugin.dump(c)
|
||||||
|
|
||||||
|
# Reset stdout
|
||||||
|
sys.stdout = old_stdout
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
self.assertEqual(mystdout.getvalue(), b"61 62 63 \n")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user