summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanshika Mishra <74042272+vanshika230@users.noreply.github.com>2023-05-02 23:09:39 +0530
committerGitHub <noreply@github.com>2023-05-02 20:39:39 +0300
commit86bf39a9d3087cad3ef56505364f49991f397cde (patch)
tree2985579c756d72b6ee9f7b707b907e365c3794f9
parent340a83e6db3628591ee6126102b3b4eeace7b138 (diff)
downloadnetworkx-86bf39a9d3087cad3ef56505364f49991f397cde.tar.gz
Improve test coverage for reaching.py (#6678)
-rw-r--r--networkx/algorithms/centrality/tests/test_reaching.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/networkx/algorithms/centrality/tests/test_reaching.py b/networkx/algorithms/centrality/tests/test_reaching.py
index 86ae8a93..02ad8322 100644
--- a/networkx/algorithms/centrality/tests/test_reaching.py
+++ b/networkx/algorithms/centrality/tests/test_reaching.py
@@ -107,3 +107,11 @@ class TestLocalReachingCentrality:
G, 1, normalized=False, weight="weight"
)
assert centrality == 1.5
+
+ def test_undirected_weighted_normalized(self):
+ G = nx.Graph()
+ G.add_weighted_edges_from([(1, 2, 1), (1, 3, 2)])
+ centrality = nx.local_reaching_centrality(
+ G, 1, normalized=True, weight="weight"
+ )
+ assert centrality == 1.0