1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
| | Fix test failure due to missing image library backend.
Cherry-picked from upstream:
https://github.com/beetbox/beets/commit/07c95a1bf16bf86c640436208dda828cc7df0181
From 07c95a1bf16bf86c640436208dda828cc7df0181 Mon Sep 17 00:00:00 2001
From: Adrian Sampson <adrian@radbox.org>
Date: Thu, 2 Jun 2016 11:39:05 -0700
Subject: [PATCH] Require an imaging backend for fuzzy ratio tests
These fail outright if we don't have a way to get image sizes (e.g.,
ImageMagick).
---
test/test_art.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/test/test_art.py b/test/test_art.py
index 02d26f4..1b12b76 100644
--- a/test/test_art.py
+++ b/test/test_art.py
@@ -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)
|