mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
use assertEqual for test cases
This commit is contained in:
parent
5fa2794386
commit
9e5f2f9249
|
@ -114,14 +114,14 @@ class TestFileGif(PillowTestCase):
|
||||||
framecount += 1
|
framecount += 1
|
||||||
img.seek(img.tell() +1)
|
img.seek(img.tell() +1)
|
||||||
except EOFError:
|
except EOFError:
|
||||||
assert(framecount == 5)
|
self.assertEqual(framecount, 5)
|
||||||
|
|
||||||
def test_dispose_none(self):
|
def test_dispose_none(self):
|
||||||
img = Image.open("Tests/images/dispose_none.gif")
|
img = Image.open("Tests/images/dispose_none.gif")
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
img.seek(img.tell() +1)
|
img.seek(img.tell() +1)
|
||||||
assert(img.disposal_method == 1)
|
self.assertEqual(img.disposal_method, 1)
|
||||||
except EOFError:
|
except EOFError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ class TestFileGif(PillowTestCase):
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
img.seek(img.tell() +1)
|
img.seek(img.tell() +1)
|
||||||
assert(img.disposal_method == 2)
|
self.assertEqual(img.disposal_method, 2)
|
||||||
except EOFError:
|
except EOFError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ class TestFileGif(PillowTestCase):
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
img.seek(img.tell() +1)
|
img.seek(img.tell() +1)
|
||||||
assert(img.disposal_method == 3)
|
self.assertEqual(img.disposal_method, 3)
|
||||||
except EOFError:
|
except EOFError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ class TestFileGif(PillowTestCase):
|
||||||
# seek to the second frame
|
# seek to the second frame
|
||||||
img.seek(img.tell() +1)
|
img.seek(img.tell() +1)
|
||||||
# all transparent pixels should be replaced with the color from the first frame
|
# all transparent pixels should be replaced with the color from the first frame
|
||||||
assert(img.histogram()[img.info['transparency']] == 0)
|
self.assertEqual(img.histogram()[img.info['transparency']], 0)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user