Exemplo n.º 1
0
 def testGetConstraintRemote(self):
     rouri      = rdflib.URIRef(remotehost+remoterobase+remoteroname)
     minimbase  = rdflib.URIRef(remotehost+remoterobase+remoteroname+remoteminim)
     constraint = ro_minim.getElementUri(minimbase, "#runnable_RO")
     model      = ro_minim.getElementUri(minimbase, "#runnable_RO_model")
     minimgraph = ro_minim.readMinimGraph(minimbase)
     c = ro_minim.getConstraint(minimgraph, rouri,
         ".",
         "Runnable")
     self.assertEquals(c['target'],   rouri)
     self.assertEquals(c['purpose'],  rdflib.Literal("Runnable"))
     self.assertEquals(c['model'],    model)
     self.assertEquals(c['uri'],      constraint)
     return
Exemplo n.º 2
0
 def testGetConstraint(self):
     self.setupConfig()
     rodir      = self.createTestRo(testbase, "test-data-1", "RO test minim", "ro-testMinim")
     rouri      = ro_manifest.getRoUri(rodir)
     minimbase  = ro_manifest.getComponentUri(rodir, "Minim-UserRequirements.rdf")
     model      = ro_minim.getElementUri(minimbase, "#runnableRequirementRO")
     constraint = ro_minim.getElementUri(minimbase, "#create/docs/UserRequirements-astro.csv")
     minimgraph = ro_minim.readMinimGraph(minimbase)
     c = ro_minim.getConstraint(minimgraph, rodir,
         "docs/UserRequirements-astro.csv",
         r"create.*UserRequirements-astro\.csv")
     self.assertEquals(c['target'],   ro_manifest.getComponentUri(rodir, "docs/UserRequirements-astro.csv"))
     self.assertEquals(c['purpose'],  rdflib.Literal("create UserRequirements-astro.csv"))
     self.assertEquals(c['model'],    model)
     self.assertEquals(c['uri'],      constraint)
     return