Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion components/tools/OmeroWeb/test/integration/test_api_rois.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
get_connection
from test_api_images import assert_objects
from omero.model import EllipseI, \
ExternalInfoI, \
ImageI, \
LengthI, \
LineI, \
Expand All @@ -37,7 +38,7 @@
RoiI

from omero.model.enums import UnitsLength
from omero.rtypes import rstring, rint, rdouble
from omero.rtypes import rstring, rint, rdouble, rlong
from omero import ValidationException


Expand Down Expand Up @@ -137,6 +138,12 @@ def image_rois(self, user1, shapes):
roi = RoiI()
for shape in shapes[:-1]:
roi.addShape(shape)
# add externalInfo to shapes on image
extinfo = ExternalInfoI()
setattr(extinfo, "entityId", rlong(3))
setattr(extinfo, "entityType", rstring("test-entity-type"))
setattr(extinfo, "lsid", rstring("test-lsid"))
shape.details.externalInfo = extinfo
roi.setImage(image)
rois.append(roi)

Expand Down Expand Up @@ -170,6 +177,15 @@ def test_image_rois(self, user1, image_rois):

# ROIs on the image
rsp = get_json(client, rois_url, {'image': image.id.val})
# Check that externalInfo is loaded
for roi in rsp['data']:
for shape in roi.get('shapes', []):
details = shape['omero:details']
extInf = details.get('externalInfo')
assert extInf is not None
assert extInf['EntityId'] == 3
assert extInf['EntityType'] == "test-entity-type"
assert extInf['Lsid'] == "test-lsid"
assert_objects(conn, rsp['data'], rois[:2], dtype="Roi",
opts={'load_shapes': True})

Expand Down
Loading