summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanshika Mishra <74042272+vanshika230@users.noreply.github.com>2023-05-02 21:16:27 +0530
committerGitHub <noreply@github.com>2023-05-02 11:46:27 -0400
commitb2bbdb3044c10c6b135c57d5e8ad12694540207b (patch)
treef60f85a0c5217b9bea6de9e4c06f637a39a16314
parentbc591fdbbe8385c8ceef3af180846fb3a971f2f8 (diff)
downloadnetworkx-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.py6
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