From 87c1be8b77c92e32a1067be4364beacd4bfb0021 Mon Sep 17 00:00:00 2001 From: William Moore Date: Wed, 27 May 2026 20:33:08 +0100 Subject: [PATCH] test_api_rois.py checks load_shapes includes externalInfo --- .../OmeroWeb/test/integration/test_api_rois.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/components/tools/OmeroWeb/test/integration/test_api_rois.py b/components/tools/OmeroWeb/test/integration/test_api_rois.py index 2b4450418d5..3aaba17c926 100644 --- a/components/tools/OmeroWeb/test/integration/test_api_rois.py +++ b/components/tools/OmeroWeb/test/integration/test_api_rois.py @@ -27,6 +27,7 @@ get_connection from test_api_images import assert_objects from omero.model import EllipseI, \ + ExternalInfoI, \ ImageI, \ LengthI, \ LineI, \ @@ -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 @@ -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) @@ -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})