コード例 #1
0
ファイル: test_io.py プロジェクト: riaanvddool/scikits-image
def test_imread_url():
    # tweak data path so that file URI works on both unix and windows.
    data_path = data_dir.lstrip(os.path.sep)
    data_path = data_path.replace(os.path.sep, '/')
    image_url = 'file:///{0}/camera.png'.format(data_path)
    image = io.imread(image_url)
    assert image.shape == (512, 512)
コード例 #2
0
ファイル: test_io.py プロジェクト: ThomasWalter/scikit-image
def test_imread_file_url():
    # tweak data path so that file URI works on both unix and windows.
    data_path = data_dir.lstrip(os.path.sep)
    data_path = data_path.replace(os.path.sep, '/')
    image_url = 'file:///{0}/camera.png'.format(data_path)
    image = io.imread(image_url)
    assert image.shape == (512, 512)
コード例 #3
0
ファイル: test_io.py プロジェクト: ChiLi90/LifetimeFit
def test_failed_temporary_file(monkeypatch, error_class):
    # tweak data path so that file URI works on both unix and windows.
    data_path = data_dir.lstrip(os.path.sep)
    data_path = data_path.replace(os.path.sep, '/')
    image_url = 'file:///{0}/camera.png'.format(data_path)
    with monkeypatch.context():
        monkeypatch.setattr(tempfile, 'NamedTemporaryFile',
                            _named_tempfile_func(error_class))
        with testing.raises(error_class):
            image = io.imread(image_url)