From f42ff652e1d16def2e13b197eadee802d997863a Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Mon, 15 Feb 2016 19:58:09 +0100 Subject: [PATCH] Experiment with using plpy from the package --- TODO.md | 2 +- python/crankshaft/crankshaft/poc/xyz.py | 4 +++- python/crankshaft/test/test_poc.py | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 64daaac..a1d89ea 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,7 @@ ### Complete the structure: * [x] Support versioning -* Test use of `plpy` from python Package +* [x] Test use of `plpy` from python Package * Add integration tests * Add `pysal` dependency and wrapper diff --git a/python/crankshaft/crankshaft/poc/xyz.py b/python/crankshaft/crankshaft/poc/xyz.py index cd5160a..4e32596 100644 --- a/python/crankshaft/crankshaft/poc/xyz.py +++ b/python/crankshaft/crankshaft/poc/xyz.py @@ -1,3 +1,5 @@ +import plpy + def xyz(): - # print "XYZ" + plpy.notice('XYZ...') return "xyz-result" diff --git a/python/crankshaft/test/test_poc.py b/python/crankshaft/test/test_poc.py index 13285ea..06fc3d6 100644 --- a/python/crankshaft/test/test_poc.py +++ b/python/crankshaft/test/test_poc.py @@ -2,6 +2,13 @@ # -*- coding: utf-8 -*- import unittest + +class MockPlPy: + def notice(self, msg): + print msg + +import sys +sys.modules['plpy'] = MockPlPy() import crankshaft class TestPoc(unittest.TestCase):