Skip to content

Commit

Permalink
Require an imaging backend for fuzzy ratio tests
Browse files Browse the repository at this point in the history
These fail outright if we don't have a way to get image sizes (e.g.,
ImageMagick).
  • Loading branch information
sampsyo committed Jun 2, 2016
1 parent 23f3998 commit 07c95a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test_art.py
Expand Up @@ -561,21 +561,25 @@ def test_respect_enforce_ratio_no(self):
self._assertImageIsValidArt(self.IMG_500x490, True)

def test_respect_enforce_ratio_px_above(self):
self._require_backend()
self.plugin.enforce_ratio = True
self.plugin.margin_px = 5
self._assertImageIsValidArt(self.IMG_500x490, False)

def test_respect_enforce_ratio_px_below(self):
self._require_backend()
self.plugin.enforce_ratio = True
self.plugin.margin_px = 15
self._assertImageIsValidArt(self.IMG_500x490, True)

def test_respect_enforce_ratio_percent_above(self):
self._require_backend()
self.plugin.enforce_ratio = True
self.plugin.margin_percent = (500 - 490) / 500 * 0.5
self._assertImageIsValidArt(self.IMG_500x490, False)

def test_respect_enforce_ratio_percent_below(self):
self._require_backend()
self.plugin.enforce_ratio = True
self.plugin.margin_percent = (500 - 490) / 500 * 1.5
self._assertImageIsValidArt(self.IMG_500x490, True)
Expand Down

0 comments on commit 07c95a1

Please sign in to comment.