Augment test coverage in PL/Python, especially for error conditions.

This commit is contained in:
Peter Eisentraut
2009-08-13 20:50:05 +00:00
parent 501255114d
commit cfe380a6dd
14 changed files with 573 additions and 34 deletions

View File

@ -26,3 +26,27 @@ select argument_test_one(users, fname, lname) from users where lname = 'doe' ord
willem doe => {fname: willem, lname: doe, userid: 3, username: w_doe}
(3 rows)
CREATE FUNCTION elog_test() RETURNS void
AS $$
plpy.debug('debug')
plpy.log('log')
plpy.info('info')
plpy.info(37)
plpy.info('info', 37, [1, 2, 3])
plpy.notice('notice')
plpy.warning('warning')
plpy.error('error')
$$ LANGUAGE plpythonu;
SELECT elog_test();
INFO: ('info',)
CONTEXT: PL/Python function "elog_test"
INFO: (37,)
CONTEXT: PL/Python function "elog_test"
INFO: ('info', 37, [1, 2, 3])
CONTEXT: PL/Python function "elog_test"
NOTICE: ('notice',)
CONTEXT: PL/Python function "elog_test"
WARNING: ('warning',)
CONTEXT: PL/Python function "elog_test"
ERROR: ('error',)
CONTEXT: PL/Python function "elog_test"