Ejemplo n.º 1
0
    def test_relationship_json(self):
        P = self.package

        node1 = P.nodes["flow"](**self.flow_data)
        node2 = P.nodes["job"] (**self.job_data)
        requires = P.relationships[("flow","requires","job")]
        edge1 = requires(node1,node2,**self.requires_data)
        json_text = edge1.json()
        edge2 = interface.convert_json2edge_container(json_text,P)

        assert( edge1 == edge2 )
        assert( edge1.id == edge2.id )
Ejemplo n.º 2
0
    def test_remove_relationship(self):
        json_rel_string = self.test_create_relationship()
        rel = interface.convert_json2edge_container(json_rel_string,self.P)
        
        rel_data = {
            "id":rel.id,
            "start":rel.start,
            "end":rel.end,
            "label":rel.label,
        }
        url = '/buildbot/api/v1.0/relationship/{start}/{label}/{end}/remove'
        response = self.delete(url,rel_data)

        stats = json.loads(response.data)
        assert(stats["relationship_deleted"]==1)
        return response.data