Skip to content

Commit

Permalink
Added test to reproduce bug perseas#103
Browse files Browse the repository at this point in the history
  • Loading branch information
dvarrazzo committed Sep 6, 2014
1 parent 2ef4829 commit 9b03d3e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/dbobject/test_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Test functions"""

import pytest
import psycopg2

from pyrseas.testutils import DatabaseToMapTestCase
from pyrseas.testutils import InputMapToSqlTestCase, fix_indent
Expand Down Expand Up @@ -124,6 +125,16 @@ def test_map_function_leakproof(self):
assert dbmap['schema public']['function f1(integer, integer)'] == \
expmap

def test_bug_103(self):
try:
self.to_map(["CREATE OR REPLACE LANGUAGE plpythonu"])
except psycopg2.OperationalError as e:
self.skipTest("plpython installation failed: %s" % e)

self.to_map(["""
CREATE FUNCTION test103() RETURNS int AS
'return 1' LANGUAGE plpythonu"""])


class FunctionToSqlTestCase(InputMapToSqlTestCase):
"""Test SQL generation from input functions"""
Expand Down

0 comments on commit 9b03d3e

Please sign in to comment.