summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanketDG <sanketdasgupta@gmail.com>2015-10-30 21:39:12 +0530
committerSanketDG <sanketdasgupta@gmail.com>2015-10-30 21:39:12 +0530
commit26fce5eecea987277294461e74dff7a7f1905986 (patch)
tree33005fa84874ba8408b2c574b461f2188621d467
parentf907b7340cc594d4d3513187df9f1523a8769c07 (diff)
downloadnetworkx-26fce5eecea987277294461e74dff7a7f1905986.tar.gz
add test for error message in eccentricity function
-rw-r--r--networkx/algorithms/tests/test_distance_measures.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/networkx/algorithms/tests/test_distance_measures.py b/networkx/algorithms/tests/test_distance_measures.py
index 1004bf4d..dfdb24bd 100644
--- a/networkx/algorithms/tests/test_distance_measures.py
+++ b/networkx/algorithms/tests/test_distance_measures.py
@@ -62,8 +62,11 @@ class TestDistance:
e = networkx.eccentricity(G)
@raises(networkx.NetworkXError)
- def test_eccentricity_invalid(self):
+ def test_eccentricity_undirected_not_connected(self):
G=networkx.Graph([(1,2),(3,4)])
e = networkx.eccentricity(G,sp=1)
-
+ @raises(networkx.NetworkXError)
+ def test_eccentricity_directed_weakly_connected(self):
+ DG = networkx.DiGraph([(1,2),(1,3)])
+ networkx.eccentricity(DG)