def testRemoveGetRoAnnotations(self):
     rodir = self.createTestRo(testbase, "data/ro-test-1", "Test remove RO annotation", "ro-testRoAnnotate")
     roresource = "."
     # Remove some anotations for RO
     ro_annotation._removeSimpleAnnotation(ro_config, rodir, roresource,
         "type",         "Research Object")
     ro_annotation._removeSimpleAnnotation(ro_config, rodir, roresource,
         "title",        "Test remove RO annotation")
     ro_annotation._removeSimpleAnnotation(ro_config, rodir, roresource,
         "description",  None)
     ro_annotation._removeSimpleAnnotation(ro_config, rodir, roresource,
         "note",         "Research object created for annotation testing")
     ro_annotation._removeSimpleAnnotation(ro_config, rodir, roresource,
         "created",      None)
     # Retrieve the anotations
     annotations = ro_annotation._getRoAnnotations(rodir)
     rouri = ro_manifest.getRoUri(rodir)
     expected_annotations = (
         [ (rouri, DCTERMS.creator,      rdflib.Literal('Test User'))
         , (rouri, DCTERMS.identifier,   rdflib.Literal('ro-testRoAnnotate'))
         , (rouri, RDF.type,             RO.ResearchObject)
         ])
     for i in range(4):
         next = annotations.next()
         #log.debug("Next %s"%(repr(next)))
         if ( next not in expected_annotations and
              next[1] != DCTERMS.created       and
              next[1] != ORE.aggregates        ):
             self.assertTrue(False, "Not expected (%d) %s"%(i, repr(next)))
     self.assertRaises(StopIteration, annotations.next)
     self.deleteTestRo(rodir)
     return
 def testGetInitialRoAnnotations(self):
     rodir = self.createTestRo(testbase, "data/ro-test-1", "Test init RO annotation", "ro-testRoAnnotate")
     roresource = "."
     # Retrieve the anotations
     annotations = ro_annotation._getRoAnnotations(rodir)
     rouri = ro_manifest.getRoUri(rodir)
     expected_annotations = (
         [ (rouri, DCTERMS.description,  rdflib.Literal('Test init RO annotation'))
         , (rouri, DCTERMS.title,        rdflib.Literal('Test init RO annotation'))
         , (rouri, DCTERMS.created,      rdflib.Literal('unknown'))
         , (rouri, DCTERMS.creator,      rdflib.Literal('Test User'))
         , (rouri, DCTERMS.identifier,   rdflib.Literal('ro-testRoAnnotate'))
         , (rouri, RDF.type,             RO.ResearchObject)
         ])
     for i in range(6+1):      # Annotations + aggregations
         next = annotations.next()
         #log.debug("Next %s"%(repr(next)))
         if ( next not in expected_annotations and
              next[1] != DCTERMS.created       and
              next[1] != ORE.aggregates        ):
             self.assertTrue(False, "Not expected (%d) %s"%(i, repr(next)))
     self.assertRaises(StopIteration, annotations.next)
     self.deleteTestRo(rodir)
     return