Fix the tests

This commit is contained in:
Javier Goizueta
2016-02-17 11:46:29 +01:00
parent 43aa7ac977
commit 3ded7da1d8
10 changed files with 33 additions and 9 deletions

View File

@@ -2,5 +2,5 @@ import plpy
def xyz():
plpy.notice('XYZ...')
r = plpy.execute("SELECT * FROM table")
return r[0]['x']
r = plpy.execute("select * from pg_class where relname='pg_class'")
return r[0]['reltype']

View File

@@ -18,6 +18,6 @@ class TestPoc(unittest.TestCase):
plpy._reset()
def test_should_have_xyz(self):
plpy._define_result('select\s+\*\s+from\s+table', [{'x': 111}])
plpy._define_result('select.*from\s+pg_class', [{'reltype': 111}])
assert crankshaft.poc.xyz() == 111
assert plpy.notices[0] == 'XYZ...'