diff options
author | SanketDG <sanketdasgupta@gmail.com> | 2015-10-30 21:39:12 +0530 |
---|---|---|
committer | SanketDG <sanketdasgupta@gmail.com> | 2015-10-30 21:39:12 +0530 |
commit | 26fce5eecea987277294461e74dff7a7f1905986 (patch) | |
tree | 33005fa84874ba8408b2c574b461f2188621d467 | |
parent | f907b7340cc594d4d3513187df9f1523a8769c07 (diff) | |
download | networkx-26fce5eecea987277294461e74dff7a7f1905986.tar.gz |
add test for error message in eccentricity function
-rw-r--r-- | networkx/algorithms/tests/test_distance_measures.py | 7 |
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) |