summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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" />