diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-26 11:30:42 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-26 11:30:42 -0400 |
commit | b0e0bbb816b578910d0e08f034a732fc5fc898fd (patch) | |
tree | 30c19a02cd5f42278942f9c517d40c2a2375b17e /test/sql/test_functions.py | |
parent | b48e0147ab03e267f01aa7270172905abe0867df (diff) | |
download | sqlalchemy-b0e0bbb816b578910d0e08f034a732fc5fc898fd.tar.gz |
- tweak the GenericFunction constructor more so that it's action in parsing the
arguments is easier to understand
- add a test to ensure generic function can have a custom name
Diffstat (limited to 'test/sql/test_functions.py')
-rw-r--r-- | test/sql/test_functions.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sql/test_functions.py b/test/sql/test_functions.py index b69f8f6ba..fc227f375 100644 --- a/test/sql/test_functions.py +++ b/test/sql/test_functions.py @@ -114,6 +114,19 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): assert isinstance(func.mypackage.myfunc(), f1) assert isinstance(func.myotherpackage.myfunc(), f2) + def test_custom_name(self): + class MyFunction(GenericFunction): + name = 'my_func' + + def __init__(self, *args): + args = args + (3,) + super(MyFunction, self).__init__(*args) + + self.assert_compile( + func.my_func(1, 2), + "my_func(:param_1, :param_2, :param_3)" + ) + def test_custom_args(self): class myfunc(GenericFunction): pass |