ENH: Add test and support for reading file URLs

This commit is contained in:
Tony S Yu
2012-10-19 15:21:31 -04:00
parent e513018052
commit 9f7a376e4d
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ from skimage.color import rgb2grey
# Shared image queue
_image_stack = []
URL_REGEX = re.compile(r'http://|https://|ftp://')
URL_REGEX = re.compile(r'http://|https://|ftp://|file://')
def is_url(filename):
+8
View File
@@ -2,6 +2,7 @@ from numpy.testing import *
import numpy as np
import skimage.io as io
from skimage import data_dir
def test_stack_basic():
@@ -15,5 +16,12 @@ def test_stack_basic():
def test_stack_non_array():
io.push([[1, 2, 3]])
def test_imread_url():
image_url = 'file://%s/camera.png' % data_dir
image = io.imread(image_url)
assert image.shape == (512, 512)
if __name__ == "__main__":
run_module_suite()