Add missing unittests for data and convert horse to binary

This commit is contained in:
François Boulogne
2016-07-17 14:13:23 +02:00
parent 418de7e4f0
commit 6685651da5
2 changed files with 40 additions and 15 deletions
+5 -1
View File
@@ -7,11 +7,13 @@ For more images, see
"""
import os as _os
import warnings
from .. import data_dir
from ..io import imread, use_plugin
from .._shared.utils import deprecated
from ._binary_blobs import binary_blobs
from .. import img_as_bool
__all__ = ['load',
'camera',
@@ -168,7 +170,9 @@ def horse():
(marauder).
"""
return load("horse.png")
with warnings.catch_warnings():
warnings.simplefilter("ignore")
return img_as_bool(load("horse.png"))
def clock():
+35 -14
View File
@@ -25,9 +25,35 @@ def test_checkerboard():
data.checkerboard()
def test_text():
""" Test that "text" image can be loaded. """
data.text()
def test_chelsea():
""" Test that "chelsea" image can be loaded. """
data.chelsea()
def test_clock():
""" Test that "clock" image can be loaded. """
data.clock()
def test_coffee():
""" Test that "coffee" image can be loaded. """
data.coffee()
def test_horse():
""" Test that "horse" image can be loaded. """
horse = data.horse()
assert_equal(horse.dtype, np.dtype('bool'))
def test_hubble():
""" Test that "Hubble" image can be loaded. """
data.hubble_deep_field()
def test_immunohistochemistry():
""" Test that "immunohistochemistry" image can be loaded. """
data.immunohistochemistry()
def test_moon():
@@ -40,19 +66,14 @@ def test_page():
data.page()
def test_clock():
""" Test that "clock" image can be loaded. """
data.clock()
def test_rocket():
""" Test that "rocket" image can be loaded. """
data.rocket()
def test_chelsea():
""" Test that "chelsea" image can be loaded. """
data.chelsea()
def test_coffee():
""" Test that "coffee" image can be loaded. """
data.coffee()
def test_text():
""" Test that "text" image can be loaded. """
data.text()
def test_binary_blobs():