[geneagrapher] 224/226: Catching ValueError at entry point.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sat Jul 11 17:11:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository geneagrapher.

commit 8101936a747eadc5b6efc9bc7d6d123a1e4ec295
Author: David Alber <alber.david at gmail.com>
Date:   Wed Jul 4 14:49:10 2012 -0700

    Catching ValueError at entry point.
    
    This fixes #16.
---
 src/geneagrapher/geneagrapher.py                | 6 +++++-
 tests/geneagrapher/test_geneagrapher_methods.py | 9 +++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/geneagrapher/geneagrapher.py b/src/geneagrapher/geneagrapher.py
index e58c108..b8bca79 100644
--- a/src/geneagrapher/geneagrapher.py
+++ b/src/geneagrapher/geneagrapher.py
@@ -145,5 +145,9 @@ def ggrapher():
     the ggrapher script is run."""
     ggrapher = Geneagrapher()
     ggrapher.parse_input()
-    ggrapher.build_graph()
+
+    try:
+        ggrapher.build_graph()
+    except ValueError, e:
+        print e
     ggrapher.generate_dot_file()
diff --git a/tests/geneagrapher/test_geneagrapher_methods.py b/tests/geneagrapher/test_geneagrapher_methods.py
index f051400..8809963 100644
--- a/tests/geneagrapher/test_geneagrapher_methods.py
+++ b/tests/geneagrapher/test_geneagrapher_methods.py
@@ -127,6 +127,15 @@ geneagrapher: error: too few arguments
         self.assertEqual(stdout_intercept.getvalue().decode('utf-8'),
                          u"Grabbing record #127946...cache hit\n")
 
+    def test_build_graph_complete_only_self_verbose_error(self):
+        """Graph building with no ancestors or descendants given a bad
+        ID."""
+        self.ggrapher.verbose = True
+        self.ggrapher.seed_ids.append(999999999)
+
+        self.assertRaises(ValueError, self.ggrapher.build_graph_complete,
+                          LocalDataGrabber)
+
     def test_build_graph_complete_only_self_verbose(self):
         """Graph building with no ancestors or descendants."""
         self.ggrapher.verbose = True

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/geneagrapher.git



More information about the debian-science-commits mailing list