def getChildConcepts(self): """ Return a collection of concepts """ return skos.Concepts([ skos.Concept('uri1', 'prefLabel1', 'definition1', 'notation1'), skos.Concept('uri2', 'prefLabel2', 'definition2', 'notation2') ])
def setUp(self): self.concepts = skos.Concepts(self.getConcepts())
def testIterable(self): clist = self.getConcepts() concepts = skos.Concepts(clist) self.assertSequenceEqual(concepts._concepts.values(), list(set(clist)))
def testMapping(self): mapping = dict(((concept.uri, concept) for concept in self.getConcepts())) concepts = skos.Concepts(mapping) self.assertEqual(concepts._concepts, mapping)
def testEqual(self): other = skos.Concepts(self.getConcepts()) self.assertEqual(self.concepts, other)