Exemple #1
0
 def test_error_on_not_exist_vertex_property(self):
     g = self.NXGraph()
     g.add_node(0, foo="node")
     with pytest.raises(
             InvalidArgumentError,
             match="graph not contains the vertex property weight"):
         sg = g.project_to_simple(v_prop="weight")
Exemple #2
0
 def test_error_on_not_exist_edge_property(self):
     g = self.NXGraph()
     g.add_edge(0, 1, weight=3)
     with pytest.raises(
         InvalidArgumentError, match="graph not contains the edge property type"
     ):
         sg = g.project_to_simple(e_prop="type")
Exemple #3
0
 def test_error_on_view_project_to_simple(self):
     g = self.NXGraph()
     g._graph = None  # a graph view always has '_graph_' attribute
     with pytest.raises(TypeError,
                        match="graph view can't project to simple graph"):
         sg = g.project_to_simple()