mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 10:46:16 +03:00
Renamed register_open accept methods for consistency
This commit is contained in:
parent
ee079ae67e
commit
d4f9c6e082
|
@ -136,25 +136,25 @@ def test_uncompressed_rgb():
|
|||
)
|
||||
|
||||
|
||||
def test__validate_true():
|
||||
def test__accept_true():
|
||||
"""Check valid prefix"""
|
||||
# Arrange
|
||||
prefix = b"DDS etc"
|
||||
|
||||
# Act
|
||||
output = DdsImagePlugin._validate(prefix)
|
||||
output = DdsImagePlugin._accept(prefix)
|
||||
|
||||
# Assert
|
||||
assert output
|
||||
|
||||
|
||||
def test__validate_false():
|
||||
def test__accept_false():
|
||||
"""Check invalid prefix"""
|
||||
# Arrange
|
||||
prefix = b"something invalid"
|
||||
|
||||
# Act
|
||||
output = DdsImagePlugin._validate(prefix)
|
||||
output = DdsImagePlugin._accept(prefix)
|
||||
|
||||
# Assert
|
||||
assert not output
|
||||
|
|
|
@ -182,9 +182,9 @@ class DdsImageFile(ImageFile.ImageFile):
|
|||
pass
|
||||
|
||||
|
||||
def _validate(prefix):
|
||||
def _accept(prefix):
|
||||
return prefix[:4] == b"DDS "
|
||||
|
||||
|
||||
Image.register_open(DdsImageFile.format, DdsImageFile, _validate)
|
||||
Image.register_open(DdsImageFile.format, DdsImageFile, _accept)
|
||||
Image.register_extension(DdsImageFile.format, ".dds")
|
||||
|
|
|
@ -98,9 +98,9 @@ class FtexImageFile(ImageFile.ImageFile):
|
|||
pass
|
||||
|
||||
|
||||
def _validate(prefix):
|
||||
def _accept(prefix):
|
||||
return prefix[:4] == MAGIC
|
||||
|
||||
|
||||
Image.register_open(FtexImageFile.format, FtexImageFile, _validate)
|
||||
Image.register_open(FtexImageFile.format, FtexImageFile, _accept)
|
||||
Image.register_extensions(FtexImageFile.format, [".ftc", ".ftu"])
|
||||
|
|
Loading…
Reference in New Issue
Block a user