mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 01:04:29 +03:00
Test with bad checksum
This commit is contained in:
parent
cac235bbd6
commit
e44773c76c
|
@ -15,7 +15,11 @@
|
|||
#
|
||||
# See the README file for information on usage and redistribution.
|
||||
#
|
||||
|
||||
# More info on this format: https://archive.org/details/gg243631
|
||||
# Page 313:
|
||||
# Figure 205. Windows Paint Version 1: "DanM" Format
|
||||
# Figure 206. Windows Paint Version 2: "LinS" Format. Used in Windows V2.03
|
||||
#
|
||||
|
||||
from . import Image, ImageFile
|
||||
from ._binary import i16le as i16, o16le as o16
|
||||
|
@ -92,6 +96,7 @@ def _save(im, fp, filename):
|
|||
# image body
|
||||
ImageFile._save(im, fp, [("raw", (0, 0)+im.size, 32, ("1", 0, 1))])
|
||||
|
||||
|
||||
#
|
||||
# registry
|
||||
|
||||
|
|
|
@ -24,6 +24,15 @@ class TestFileMsp(PillowTestCase):
|
|||
self.assertRaises(SyntaxError,
|
||||
lambda: MspImagePlugin.MspImageFile(invalid_file))
|
||||
|
||||
def test_bad_checksum(self):
|
||||
# Arrange
|
||||
# This was created by forcing Pillow to save with checksum=0
|
||||
bad_checksum = "Tests/images/hopper_bad_checksum.msp"
|
||||
|
||||
# Act / Assert
|
||||
self.assertRaises(SyntaxError,
|
||||
lambda: MspImagePlugin.MspImageFile(bad_checksum))
|
||||
|
||||
def test_open(self):
|
||||
# Arrange
|
||||
# Act
|
||||
|
|
Loading…
Reference in New Issue
Block a user