mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
don't use bare asserts, don't mask file builtin with local
This commit is contained in:
parent
e1e64904c7
commit
0492409def
|
@ -255,22 +255,22 @@ def test_save_icc_profile_none():
|
|||
# check saving files with an ICC profile set to None (omit profile)
|
||||
in_file = "Tests/images/icc_profile_none.png"
|
||||
im = Image.open(in_file)
|
||||
assert im.info['icc_profile'] is None
|
||||
assert_equal(im.info['icc_profile'], None)
|
||||
|
||||
file = tempfile("temp.png")
|
||||
assert_no_exception(lambda: im.save(file))
|
||||
im = Image.open(file)
|
||||
assert 'icc_profile' not in im.info
|
||||
f = tempfile("temp.png")
|
||||
assert_no_exception(lambda: im.save(f))
|
||||
im = Image.open(f)
|
||||
assert_false('icc_profile' in im.info)
|
||||
|
||||
def test_save_icc_profile_exists():
|
||||
# check icc profile is kept during save()
|
||||
in_file = "Tests/images/trollface.png"
|
||||
im = Image.open(in_file)
|
||||
orig_profile = im.info['icc_profile']
|
||||
assert len(orig_profile) == 6636
|
||||
assert_equal(len(orig_profile), 6636)
|
||||
|
||||
file = tempfile("temp.png")
|
||||
assert_no_exception(lambda: im.save(file))
|
||||
f = tempfile("temp.png")
|
||||
assert_no_exception(lambda: im.save(f))
|
||||
|
||||
im = Image.open(file)
|
||||
assert im.info['icc_profile'] == orig_profile
|
||||
im = Image.open(f)
|
||||
assert_equal(im.info['icc_profile'], orig_profile)
|
||||
|
|
Loading…
Reference in New Issue
Block a user