Stack Trace
self = <test.integration.gatewaytest.test_get_objects.TestGetObject object at 0x7f76b5ef3510>
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()
child = omero.gateway.CommentAnnotationWrapper(conn)
child.setNs("test.annotation.child")
child.setValue("test annotation child Comment")
child.save()
child2 = omero.gateway.LongAnnotationWrapper(conn)
child2.setNs("test.annotation.child")
child2.setValue(123)
child2.save()
# link child to parent
parent.linkAnnotation(child)
parent.linkAnnotation(child2)
group = conn.getGroupFromContext()
# Also annotate the Group
> group.linkAnnotation(child)
test/integration/gatewaytest/test_get_objects.py:820:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../../.venv3/lib64/python3.11/site-packages/omero/gateway/__init__.py:1158: in linkAnnotation
ann = self._linkAnnotation(ann)
^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../.venv3/lib64/python3.11/site-packages/omero/gateway/__init__.py:1090: in _linkAnnotation
return self._linkObject(ann, "%sI" % link_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_ExperimenterGroupWrapper id=2745>
obj = <CommentAnnotationWrapper id=5395>
lnkobjtype = 'ExperimenterGroupAnnotationLinkI'
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)
^^^^^^^^^^^^^^^^^^^^^
E AttributeError: 'NoneType' object has no attribute 'id'
../../../../.venv3/lib64/python3.11/site-packages/omero/gateway/__init__.py:1066: AttributeError