Ejemplo n.º 1
0
 def test_create(self):
     # Should be able to create an edge with a competency and occupation
     competency = Competency(identifier='123', name='communication', categories=['social skills'])
     occupation = Occupation(identifier='456', name='Civil Engineer')
     edge = CompetencyOccupationEdge(competency=competency, occupation=occupation)
     assert edge.competency == competency
     assert edge.occupation == occupation
Ejemplo n.º 2
0
    def test_fromjsonld(self):
        jsonld_input = {
            '@type': 'CompetencyOccupationEdge',
            '@id': 'competency=111&occupation=123',
            'competency': {
                '@type': 'Competency',
                '@id': '111'
            },
            'occupation': {
                '@type': 'Occupation',
                '@id': '123'
            }
        }

        competency = Competency(identifier='111')
        occupation = Occupation(identifier='123')
        target_edge = CompetencyOccupationEdge(competency=competency, occupation=occupation)

        edge = CompetencyOccupationEdge.from_jsonld(jsonld_input)
        assert edge == target_edge
Ejemplo n.º 3
0
 def test_jsonld(self):
     competency = Competency(identifier='111', name='communication', categories=['social skills'])
     occupation = Occupation(identifier='123', name='Civil Engineer')
     edge = CompetencyOccupationEdge(competency=competency, occupation=occupation)
     assert edge.jsonld_full == {
         '@type': 'CompetencyOccupationEdge',
         '@id': 'competency=111&occupation=123',
         'competency': {
             '@type': 'Competency',
             '@id': '111'
         },
         'occupation': {
             '@type': 'Occupation',
             '@id': '123'
         }
     }