def omero_napari(image_id): from retrieval import get_image from napari_viewer import view_image image = get_image(image_id) viewer = view_image(image) conn = image._conn conn.close()
def gen_image_viewer(): from retrieval import get_image from unittest.mock import Mock img_id = 957 viewer = Mock() return [get_image(img_id), viewer]
def test_inexistent_image(): big_id = 99999999999 assert get_image(big_id) == None assert get_image(-10) == None
def test_empty_imageid(): assert get_image(None) == None
def test_get_data_lazy(): test_id = 957 assert get_data_lazy(get_image(test_id)).shape == (51, 5, 196, 171)
def test_get_image(): img_id = 1 assert get_image(img_id).getId() == img_id