Beispiel #1
0
 def testGetAttrGood(self):
     i = ImageI()
     assert i.loaded
     assert i.isLoaded()
     assert not i.name
     i.name = rstring("name")
     assert i.name
     i.setName(None)
     assert not i.getName()
     i.copyAnnotationLinks()
     i.linkAnnotation(omero.model.BooleanAnnotationI())
Beispiel #2
0
 def testGetAttrGood(self):
     i = ImageI()
     self.assert_(i.loaded)
     self.assert_(i.isLoaded())
     self.assert_(not i.name)
     i.name = rstring("name")
     self.assert_(i.name)
     i.setName(None)
     self.assert_(not i.getName())
     i.copyAnnotationLinks()
     i.linkAnnotation(omero.model.BooleanAnnotationI())
Beispiel #3
0
 def testSequences(self):
     img = ImageI()
     assert img.sizeOfAnnotationLinks() >= 0
     img.linkAnnotation(None)
     img.unload()
     try:
         assert not img.sizeOfAnnotationLinks() >= 0
         assert len(img.copyAnnotationLinks()) == 0
         assert False, "can't reach here"
     except:
         # These are true, but can't be tested
         pass
Beispiel #4
0
 def testSequences(self):
     img = ImageI()
     self.assert_(img.sizeOfAnnotationLinks() >= 0)
     img.linkAnnotation(None)
     img.unload()
     try:
         self.assert_(not img.sizeOfAnnotationLinks() >= 0)
         self.assert_(len(img.copyAnnotationLinks()) == 0)
         self.fail("can't reach here")
     except:
         # These are true, but can't be tested
         pass
Beispiel #5
0
 def testSequences(self):
     img = ImageI()
     assert img.sizeOfAnnotationLinks() >= 0
     img.linkAnnotation(None)
     img.unload()
     try:
         assert not img.sizeOfAnnotationLinks() >= 0
         assert len(img.copyAnnotationLinks()) == 0
         assert False, "can't reach here"
     except:
         # These are true, but can't be tested
         pass
Beispiel #6
0
 def testSequences(self):
     img = ImageI()
     self.assert_( img.sizeOfAnnotationLinks() >= 0 )
     img.linkAnnotation(None)
     img.unload()
     try:
         self.assert_( not img.sizeOfAnnotationLinks() >= 0 )
         self.assert_( len(img.copyAnnotationLinks()) == 0 )
         self.fail("can't reach here")
     except:
         # These are true, but can't be tested
         pass
Beispiel #7
0
    def testBasicUsage(self):
        usr = self.client.sf.getAdminService().getEventContext().userId

        img = ImageI()
        img.name = rstring("name")
        img.acquisitionDate = rtime(0)
        tag = TagAnnotationI()
        img.linkAnnotation(tag)

        img = self.client.sf.getUpdateService().saveAndReturnObject(img)

        img = self.client.sf.getQueryService().findByQuery(
            """
        select img from Image img
        join fetch img.annotationLinksCountPerOwner
        where img.id = %s
        """ % (img.id.val), None)
        self.assert_(img)
        self.assert_(img.getAnnotationLinksCountPerOwner()[usr] > 0)
Beispiel #8
0
    def testBasicUsage(self):
        usr = self.client.sf.getAdminService().getEventContext().userId

        img = ImageI()
        img.name = rstring("name")
        img.acquisitionDate = rtime(0)
        tag = TagAnnotationI()
        img.linkAnnotation(tag)

        img = self.client.sf.getUpdateService().saveAndReturnObject(img)

        img = self.client.sf.getQueryService().findByQuery(
            """
            select img from Image img
            join fetch img.annotationLinksCountPerOwner
            where img.id = %s
            """ % (img.id.val), None
            )
        assert img
        assert img.getAnnotationLinksCountPerOwner()[usr] > 0