Move tests to pil plugin and fix file path

This commit is contained in:
Steven Silvester
2015-05-09 10:22:48 -05:00
parent d351c13c2d
commit 5f067ff43b
2 changed files with 18 additions and 20 deletions
-20
View File
@@ -61,26 +61,6 @@ def test_bilevel():
assert_array_equal(img.astype(bool), expected)
@skipif(not imread_available)
def test_imread_separate_channels():
# Test that imread returns RGBA values contiguously even when they are
# stored in separate planes.
x = np.random.rand(3, 16, 8)
f = NamedTemporaryFile(suffix='.tif')
fname = f.name
f.close()
imsave(fname, x)
img = imread(fname)
os.remove(fname)
assert img.shape == (16, 8, 3), img.shape
@skipif(not imread_available)
def test_imread_multipage_rgb_tif():
img = imread(os.path.join(data_dir, 'multipage_rgb.png'))
assert img.shape == (10, 10, 3), img.shape
class TestSave:
def roundtrip(self, x, scaling=1):
f = NamedTemporaryFile(suffix='.png')
+18
View File
@@ -50,6 +50,24 @@ def test_imread_flatten():
assert np.sctype2char(img.dtype) in np.typecodes['AllInteger']
def test_imread_separate_channels():
# Test that imread returns RGBA values contiguously even when they are
# stored in separate planes.
x = np.random.rand(3, 16, 8)
f = NamedTemporaryFile(suffix='.tif')
fname = f.name
f.close()
imsave(fname, x)
img = imread(fname)
os.remove(fname)
assert img.shape == (16, 8, 3), img.shape
def test_imread_multipage_rgb_tif():
img = imread(os.path.join(data_dir, 'multipage_rgb.tif'))
assert img.shape == (10, 10, 3), img.shape
def test_imread_palette():
img = imread(os.path.join(data_dir, 'palette_gray.png'))
assert img.ndim == 2