[geneagrapher] 203/226: Use LocalDataGrabber path-determination function.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Sat Jul 11 17:11:10 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 249bb3a6c79312904c965afceaa8958f47f6f3ef
Author: David Alber <alber.david at gmail.com>
Date: Mon Dec 26 12:46:37 2011 -0800
Use LocalDataGrabber path-determination function.
This change modifies the Grabber test local data path computing
function to call the LocalDataGrabber's similar function. Doing
this avoids having the same code in two places.
---
tests/geneagrapher/test_grabber_methods.py | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/tests/geneagrapher/test_grabber_methods.py b/tests/geneagrapher/test_grabber_methods.py
index 621c5c9..4b3c04a 100644
--- a/tests/geneagrapher/test_grabber_methods.py
+++ b/tests/geneagrapher/test_grabber_methods.py
@@ -3,18 +3,19 @@ import sys
from BeautifulSoup import BeautifulSoup
import unittest
from geneagrapher.grabber import *
+from local_data_grabber import LocalDataGrabber
class TestGrabberMethods(unittest.TestCase):
+ def data_file(self, filename):
+ """Return the absolute path to the data file with given name."""
+ return LocalDataGrabber.data_file(filename)
+
def test_init(self):
"""Test constructor."""
grabber = Grabber()
self.assertIsInstance(grabber, Grabber)
- def data_file(self, filename):
- """Return the absolute path to the data file with given name."""
- return os.path.join(self.data_path, filename)
-
def test_get_record_bad(self):
"""Verify exception thrown from get_record() method for bad id."""
grabber = Grabber()
@@ -169,11 +170,6 @@ class TestGrabberMethods(unittest.TestCase):
if __name__ == '__main__':
file_path = os.path.abspath(sys.argv[0])
- TestGrabberMethods.data_path = os.path.join(os.path.dirname(file_path),
- 'testdata')
unittest.main()
else:
file_path = os.path.abspath(sys.argv[0])
- TestGrabberMethods.data_path = os.path.join(os.path.dirname(file_path),
- 'tests', 'geneagrapher',
- 'testdata')
--
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