def tagset_tag(request, itest, update_service): """ Returns a new OMERO TagAnnotation, with the OMERO.insight tagset namespace set, and linked TagAnnotation with required fields set. """ tagset = TagAnnotationI() tagset.ns = rstring(omero.constants.metadata.NSINSIGHTTAGSET) tagset.textValue = rstring(itest.uuid()) tag = TagAnnotationI() tag.textValue = rstring(itest.uuid()) tagset.linkAnnotation(tag) return update_service.saveAndReturnObject(tagset)
def tagset_tag(self): """ Returns a new OMERO TagAnnotation, with the OMERO.insight tagset namespace set, and linked TagAnnotation with required fields set. """ tagset = TagAnnotationI() tagset.ns = rstring(omero.constants.metadata.NSINSIGHTTAGSET) tagset.textValue = rstring(self.uuid()) tag = TagAnnotationI() tag.textValue = rstring(self.uuid()) tagset.linkAnnotation(tag) return self.update.saveAndReturnObject(tagset)
def test_tag_annotation(self): """Tests AnnotationWrapper methods return strings""" ns = u'πλζ.test.ζ' text_value = u'Tαg - ℗' obj = TagAnnotationI() obj.textValue = rstring(text_value) obj.ns = rstring(ns) tag = MockConnection(obj).getObject("Annotation", 1) assert tag.getValue() == text_value.encode('utf8') assert tag.textValue == text_value assert tag.getNs() == ns.encode('utf8') assert tag.ns == ns