def test_load_nickel_ebsd_large_allow_download(self): """Download from external.""" s = data.nickel_ebsd_large(lazy=True, allow_download=True) assert isinstance(s, LazyEBSD) assert s.data.shape == (55, 75, 60, 60) assert np.issubdtype(s.data.dtype, np.uint8)
def test_load_nickel_ebsd_large_raises(self): """Raises desired error message.""" file = data.cache_data_path.joinpath("nickel_ebsd_large/patterns.h5") if file.exists(): # pragma: no cover os.remove(file) os.rmdir(file.parent) with pytest.raises(ValueError, match="The dataset must be"): _ = data.nickel_ebsd_large(allow_download=False)