summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networkx/algorithms/assortativity/tests/test_neighbor_degree.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/networkx/algorithms/assortativity/tests/test_neighbor_degree.py b/networkx/algorithms/assortativity/tests/test_neighbor_degree.py
index 27abbb0e..bf1252d5 100644
--- a/networkx/algorithms/assortativity/tests/test_neighbor_degree.py
+++ b/networkx/algorithms/assortativity/tests/test_neighbor_degree.py
@@ -47,6 +47,10 @@ class TestAverageNeighbor:
assert nd == {0: 0, 1: 1, 2: 1, 3: 1}
nd = nx.average_neighbor_degree(D, "out", "in", weight="weight")
assert nd == {0: 1, 1: 1, 2: 1, 3: 0}
+ nd = nx.average_neighbor_degree(D, source="in+out", weight="weight")
+ assert nd == {0: 1.0, 1: 1.0, 2: 0.8, 3: 1.0}
+ nd = nx.average_neighbor_degree(D, target="in+out", weight="weight")
+ assert nd == {0: 2.0, 1: 2.0, 2: 1.0, 3: 0.0}
D = G.to_directed()
nd = nx.average_neighbor_degree(D, weight="weight")