Stack Trace
self = <test.integration.gatewaytest.test_get_objects.TestGetObject object at 0x7fddbcd7f110>
def testAnnotationAnnotationLinks(self):
"""
Test various annotations methods when parent is an Annotation or Group
"""
group = self.new_group(perms='rwra--')
client, user = self.new_client_and_user(group=group)
conn = BlitzGateway(client_obj=client)
parent = omero.gateway.TagAnnotationWrapper(conn)
parent.setNs("test.annotation.parent")
parent.setValue("parent Tag")
parent.save()
COMMENT_TEXT = "test annotation child Comment"
child = omero.gateway.CommentAnnotationWrapper(conn)
child.setNs("test.annotation.child")
child.setValue(COMMENT_TEXT)
child.save()
child2 = omero.gateway.LongAnnotationWrapper(conn)
child2.setNs("test.annotation.child")
child2.setValue(123)
child2.save()
# link child to parent
> parent.linkAnnotation(child)
test/integration/gatewaytest/test_get_objects.py:817:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../../.venv3/lib64/python3.11/site-packages/omero/gateway/__init__.py:1133: in linkAnnotation
ann = self._linkAnnotation(ann)
^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../.venv3/lib64/python3.11/site-packages/omero/gateway/__init__.py:1065: in _linkAnnotation
return self._linkObject(ann, "%sAnnotationLinkI" % self.OMERO_CLASS)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <TagAnnotationWrapper id=5387>, obj = <CommentAnnotationWrapper id=5388>
lnkobjtype = 'NoneAnnotationLinkI'
def _linkObject(self, obj, lnkobjtype):
"""
Saves the object to DB if needed - setting the permissions manually.
Creates the object link and saves it, setting permissions manually.
TODO: Can't set permissions manually in 4.2
- Assumes world & group writable
:param obj: The object to link
:type obj: :class:`BlitzObjectWrapper`
"""
ctx = self._conn.SERVICE_OPTS.copy()
ctx.setOmeroGroup(self.details.group.id.val)
if not obj.getId():
# Not yet in db, save it
obj = obj.__class__(
self._conn,
self._conn.getUpdateService().saveAndReturnObject(
obj._obj, ctx))
> lnk = getattr(omero.model, lnkobjtype)()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E AttributeError: module 'omero.model' has no attribute 'NoneAnnotationLinkI'
../../../../.venv3/lib64/python3.11/site-packages/omero/gateway/__init__.py:1049: AttributeError