summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-04-30 10:49:52 -0300
committerHugo Parente Lima <hugo.lima@openbossa.org>2010-04-30 18:36:40 -0300
commit425fd9ef6e65aa1c951e761d33ef1cbcd3571c22 (patch)
tree0ef86d00fc43a6801505d9ca0dd3785e99dae8d5
parent60c2c6adecf05648e2938995f7f5c6969303d0ab (diff)
Added tests for user added functions declared inside namespaces.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Reviewer: Renato Ara├║jo <renato.araujo@openbossa.org>
-rwxr-xr-xtests/samplebinding/namespace_test.py4
-rw-r--r--tests/samplebinding/typesystem_sample.xml5
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/samplebinding/namespace_test.py b/tests/samplebinding/namespace_test.py
index 003d81b1..29633f38 100755
--- a/tests/samplebinding/namespace_test.py
+++ b/tests/samplebinding/namespace_test.py
@@ -36,5 +36,9 @@ class TestClassesUnderNamespace(unittest.TestCase):
c3 = SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough()
e3 = SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough.NiceEnum()
+ def testFunctionAddedOnNamespace(self):
+ res = SampleNamespace.ImInsideANamespace(2, 2)
+ self.assertEquals(res, 4)
+
if __name__ == '__main__':
unittest.main()
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index 38311bd7..3b0eb906 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -95,6 +95,11 @@
</conversion-rule>
</modify-argument>
</modify-function>
+ <add-function signature="ImInsideANamespace(int, int)" return-type="int">
+ <inject-code class="target">
+ %PYARG_0 = %CONVERTTOPYTHON[int](%1 + %2);
+ </inject-code>
+ </add-function>
</namespace-type>
<value-type name="SampleNamespace::SomeClass" />