Stack Trace
gatewaywrapper = <omero.gateway.pytest_fixtures.GatewayWrapper object at 0x7f4731b36510>
def testNonDefGroupAnnotation(gatewaywrapper):
p = gatewaywrapper.getTestProject2()
> return _testAnnotation(p,
omero.gateway.CommentAnnotationWrapper,
TESTANN_NS, 'some value')
test/integration/gatewaytest/test_annotation.py:122:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
obj = <_ProjectWrapper id=491>
annclass = <class 'omero.gateway.CommentAnnotationWrapper'>
ns = 'omero.gateway.test_annotation', value = 'some value', sameOwner = False
testOwner = None
def _testAnnotation(obj, annclass, ns, value, sameOwner=False,
testOwner=None):
gateway = obj._conn
# Make sure it doesn't yet exist
obj.removeAnnotations(ns)
assert obj.getAnnotation(ns) is None
# Create new, link and check
ann = annclass(gateway)
ann.setNs(ns)
ann.setValue(value)
if sameOwner:
obj.linkAnnotation(ann, sameOwner=True)
else:
# checks that default sameOwner=False
obj.linkAnnotation(ann)
ann = obj.getAnnotation(ns)
# Make sure the group for the annotation is the same as the original
# object. (#120)
assert ann.getDetails().getGroup() == obj.getDetails().getGroup()
tval = hasattr(value, 'val') and value.val or value
assert ann.getValue() == value, '%s != %s' % (str(ann.getValue()),
str(tval))
assert ann.getNs() == ns, '%s != %s' % (str(ann.getNs()), str(ns))
if testOwner is not None:
testOwner(obj, ann)
# test conn.countAnnotations()
counts = gateway.countAnnotations(obj.OMERO_CLASS, [obj.id])
assert counts is not None
# Timestamp and Boolean not included in counts
if annclass.OMERO_CLASS not in ["TimestampAnnotation",
"BooleanAnnotation",
# LongAnnotation is only for 'rating'
"LongAnnotation"]:
> assert counts[annclass.OMERO_CLASS] >= 1. # e.g. TagAnnotation: 1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E KeyError: None
test/integration/gatewaytest/test_annotation.py:59: KeyError