mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 01:16:16 +03:00
Decreased length of test image data
This commit is contained in:
parent
f99e0b824b
commit
3e9068a345
|
@ -707,7 +707,7 @@ class TestFileJpeg:
|
||||||
assert im.info["icc_profile"] == b"profile"
|
assert im.info["icc_profile"] == b"profile"
|
||||||
|
|
||||||
def test_reading_not_whole_file_for_define_it_type(self):
|
def test_reading_not_whole_file_for_define_it_type(self):
|
||||||
size = 1024 ** 2
|
size = 4097
|
||||||
buffer = BytesIO(b"\xFF" * size) # Many xFF bytes
|
buffer = BytesIO(b"\xFF" * size) # Many xFF bytes
|
||||||
buffer.max_pos = 0
|
buffer.max_pos = 0
|
||||||
orig_read = buffer.read
|
orig_read = buffer.read
|
||||||
|
@ -721,10 +721,8 @@ class TestFileJpeg:
|
||||||
with pytest.raises(OSError):
|
with pytest.raises(OSError):
|
||||||
Image.open(buffer)
|
Image.open(buffer)
|
||||||
|
|
||||||
# Only small part of file has been read.
|
# Assert the entire file has not been read
|
||||||
# The upper limit of max_pos (8Kb) was chosen experimentally
|
assert 0 < buffer.max_pos < size
|
||||||
# and increased approximately twice.
|
|
||||||
assert 0 < buffer.max_pos < 8 * 1024
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(not is_win32(), reason="Windows only")
|
@pytest.mark.skipif(not is_win32(), reason="Windows only")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user