diff --git a/python/crankshaft/test/helper.py b/python/crankshaft/test/helper.py index b87a12a..7d28b94 100644 --- a/python/crankshaft/test/helper.py +++ b/python/crankshaft/test/helper.py @@ -5,3 +5,9 @@ plpy = MockPlPy() import sys sys.modules['plpy'] = plpy + +import os + +def fixture_file(name): + dir = os.path.dirname(os.path.realpath(__file__)) + return os.path.join(dir, 'fixtures', name) diff --git a/python/crankshaft/test/test_clustering_moran.py b/python/crankshaft/test/test_clustering_moran.py index 6f3fa14..2e730a1 100644 --- a/python/crankshaft/test/test_clustering_moran.py +++ b/python/crankshaft/test/test_clustering_moran.py @@ -9,7 +9,7 @@ import unittest # # import sys # sys.modules['plpy'] = plpy -from helper import plpy +from helper import plpy, fixture_file import crankshaft.clustering as cc from crankshaft import random_seeds @@ -26,8 +26,8 @@ class MoranTest(unittest.TestCase): "table": "a_list", "geom_col": "the_geom", "num_ngbrs": 321} - self.neighbors_data = json.loads(open('test/fixtures/neighbors.json').read()) - self.moran_data = json.loads(open('test/fixtures/moran.json').read()) + self.neighbors_data = json.loads(open(fixture_file('neighbors.json')).read()) + self.moran_data = json.loads(open(fixture_file('moran.json')).read()) def test_map_quads(self): """Test map_quads."""