def test_vertex_get_rest(self, client: HiroClient): from arago.hiro.backend.six.graph import Hiro6GraphRest graph = Hiro6GraphRest(client) vertex_id = OgitEntity.OGIT_COMMENT.value.name.uri res = graph.vertex.get(vertex_id) res.raise_for_status() assert isinstance(res, Response) pass
def test_vertex_delete_rest(self, client: HiroClient): from arago.hiro.backend.six.graph import Hiro6GraphModel from arago.hiro.backend.six.graph import Hiro6GraphRest graph_m = Hiro6GraphModel(client) graph = Hiro6GraphRest(client) comment_v = graph_m.vertex.create(OgitEntity.OGIT_COMMENT) res = graph.vertex.delete(comment_v.id) res.raise_for_status() assert isinstance(res, Response) pass
def test_vertex_history_rest(self, client: HiroClient): from arago.hiro.backend.six.graph import Hiro6GraphRest res = client.root.model.search.index( rf'''ogit\/_type:"{OgitEntity.OGIT_LICENSE_REQUEST.value.name.uri!s}"''' ) vertex = next(res) graph = Hiro6GraphRest(client) v_res = graph.vertex.history(vertex.id) v_res.raise_for_status() assert isinstance(v_res, Response) pass
def test_edge_delete_rest(self, client: HiroClient): from arago.hiro.backend.six.graph import Hiro6GraphModel from arago.hiro.backend.six.graph import Hiro6GraphRest graph_m = Hiro6GraphModel(client) graph = Hiro6GraphRest(client) vertex_a = graph_m.vertex.create(OgitEntity.OGIT_ATTACHMENT) vertex_b = graph_m.vertex.create(OgitEntity.OGIT_COMMENT) edge_c = graph_m.edge.create(vertex_a, OgitVerb.OGIT_BELONGS, vertex_b) res = graph.edge.delete(edge_c.id) res.raise_for_status() isinstance(res, Response) pass
def test_edge_create_rest(self, client: HiroClient): from arago.hiro.backend.six.graph import Hiro6GraphModel from arago.hiro.backend.six.graph import Hiro6GraphRest graph_m = Hiro6GraphModel(client) graph = Hiro6GraphRest(client) vertex_a = graph_m.vertex.create(OgitEntity.OGIT_ATTACHMENT) vertex_b = graph_m.vertex.create(OgitEntity.OGIT_COMMENT) req_data = { 'out': str(vertex_a.id), 'in': str(vertex_b.id), } edge_type = OgitVerb.OGIT_BELONGS.value.name.uri res = graph.edge.create(edge_type, req_data) res.raise_for_status() isinstance(res, Response) pass