Update icon test to allow for a little bit of fuzz

Different systems appear to perform rounding a bit different
in either direction. This allows for the height of the image (the
height is not set as a fixed value) to be a bit fuzzy.
This commit is contained in:
Matt Basta 2012-09-17 14:04:38 -07:00
Родитель f70969bb27
Коммит 440ad9690c
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -100,7 +100,12 @@ def _uploader(resize_size, final_size):
with storage.open(dest.name) as fp:
dest_image = Image.open(fp)
dest_image.load()
eq_(dest_image.size, final_size)
# Assert that the width is always identical.
eq_(dest_image.size[0], final_size[0])
# Assert that the height can be a wee bit fuzzy.
assert -1 <= dest_image.size[1] - final_size[1] <= 1, (
"Got width %d, expected %d" % (final_size[1], dest_image.size[1]))
assert not os.path.exists(src.name)