diff options
author | Vanshika Mishra <74042272+vanshika230@users.noreply.github.com> | 2023-05-02 21:16:27 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-02 11:46:27 -0400 |
commit | b2bbdb3044c10c6b135c57d5e8ad12694540207b (patch) | |
tree | f60f85a0c5217b9bea6de9e4c06f637a39a16314 | |
parent | bc591fdbbe8385c8ceef3af180846fb3a971f2f8 (diff) | |
download | networkx-b2bbdb3044c10c6b135c57d5e8ad12694540207b.tar.gz |
Improve Test Coverage for current_flow_closeness.py (#6677)
Improve_test_coverage_cfc.py
-rw-r--r-- | networkx/algorithms/centrality/tests/test_current_flow_closeness.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/networkx/algorithms/centrality/tests/test_current_flow_closeness.py b/networkx/algorithms/centrality/tests/test_current_flow_closeness.py index 24a916a4..2528d622 100644 --- a/networkx/algorithms/centrality/tests/test_current_flow_closeness.py +++ b/networkx/algorithms/centrality/tests/test_current_flow_closeness.py @@ -32,6 +32,12 @@ class TestFlowClosenessCentrality: for n in sorted(G): assert b[n] == pytest.approx(b_answer[n], abs=1e-7) + def test_current_flow_closeness_centrality_not_connected(self): + G = nx.Graph() + G.add_nodes_from([1, 2, 3]) + with pytest.raises(nx.NetworkXError): + nx.current_flow_closeness_centrality(G) + class TestWeightedFlowClosenessCentrality: pass |