Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/networkx/algorithms/tests/test_moral.py @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author | shellac |
---|---|
date | Mon, 22 Mar 2021 18:12:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4f3585e2f14b |
---|---|
1 import networkx as nx | |
2 | |
3 from networkx.algorithms.moral import moral_graph | |
4 | |
5 | |
6 def test_get_moral_graph(): | |
7 graph = nx.DiGraph() | |
8 graph.add_nodes_from([1, 2, 3, 4, 5, 6, 7]) | |
9 graph.add_edges_from([(1, 2), (3, 2), (4, 1), (4, 5), (6, 5), (7, 5)]) | |
10 H = moral_graph(graph) | |
11 assert not H.is_directed() | |
12 assert H.has_edge(1, 3) | |
13 assert H.has_edge(4, 6) | |
14 assert H.has_edge(6, 7) | |
15 assert H.has_edge(4, 7) | |
16 assert not H.has_edge(1, 5) |