MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / test_from_graph

Function test_from_graph

easygraph/classes/tests/test_hypergraph.py:53–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51
52
53def test_from_graph():
54 g = eg.Graph()
55 g.add_nodes(range(0, 5))
56 g.add_edges(
57 [(0, 1), (0, 3), (1, 4), (2, 3), (3, 4)],
58 [
59 {"weight": 1.0},
60 {"weight": 1.0},
61 {"weight": 1.0},
62 {"weight": 1.0},
63 {"weight": 1.0},
64 ],
65 )
66 hg = eg.Hypergraph.from_graph(g)
67 assert hg.num_e == 5
68 assert (0, 1) in hg.e[0]
69 assert (1, 4) in hg.e[0]
70
71
72def test_from_graph_kHop():

Callers

nothing calls this directly

Calls 4

add_nodesMethod · 0.95
add_edgesMethod · 0.95
GraphMethod · 0.80
from_graphMethod · 0.80

Tested by

no test coverage detected