Add test case for separate scale factors

This commit is contained in:
Johannes Schönberger
2012-10-05 06:21:28 +02:00
parent c2d308c21a
commit 8ca068ed19
+9
View File
@@ -95,6 +95,7 @@ def test_resize():
def test_scale():
# same scale factor
x = np.zeros((5, 5), dtype=np.double)
x[1, 1] = 1
scaled = scale(x, 2, order=0)
@@ -102,6 +103,14 @@ def test_scale():
ref[2:4, 2:4] = 1
assert_array_almost_equal(scaled, ref)
# different scale factors
x = np.zeros((5, 5), dtype=np.double)
x[1, 1] = 1
scaled = scale(x, (2, 1), order=0)
ref = np.zeros((10, 5))
ref[2:4, 1] = 1
assert_array_almost_equal(scaled, ref)
def test_swirl():
image = img_as_float(data.checkerboard())