summaryrefslogtreecommitdiffstats
path: root/tests/test_everything.py
diff options
context:
space:
mode:
authorZach Goldberg <zach@zachgoldberg.com>2010-04-17 12:00:05 -0400
committerZach Goldberg <zach@zachgoldberg.com>2010-04-18 11:21:12 -0400
commit79aa416ae8632b123da61d79fb820d9e2704209c (patch)
treed4644c7789e8809f0560d2bacac61ab9b509ecd4 /tests/test_everything.py
parent7d533b8893bc4a8a82fd9708278fa1dce5d3551e (diff)
downloadpygi-79aa416ae8632b123da61d79fb820d9e2704209c.tar.gz
pygi-79aa416ae8632b123da61d79fb820d9e2704209c.tar.xz
pygi-79aa416ae8632b123da61d79fb820d9e2704209c.zip
Implement nullable argument support, including tests
https://bugzilla.gnome.org/show_bug.cgi?id=616035
Diffstat (limited to 'tests/test_everything.py')
-rw-r--r--tests/test_everything.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_everything.py b/tests/test_everything.py
index 8347081..148b8af 100644
--- a/tests/test_everything.py
+++ b/tests/test_everything.py
@@ -46,6 +46,34 @@ class TestEverything(unittest.TestCase):
self.assertEquals(surface.get_width(), 10)
self.assertEquals(surface.get_height(), 10)
+
+class TestNullableArgs(unittest.TestCase):
+ def test_in_nullable_hash(self):
+ Everything.test_ghash_null_in(None)
+
+ def test_in_nullable_list(self):
+ Everything.test_gslist_null_in(None)
+ Everything.test_glist_null_in(None)
+
+ def test_in_nullable_array(self):
+ Everything.test_array_int_null_in(None, -1)
+
+ def test_in_nullable_string(self):
+ Everything.test_utf8_null_in(None)
+
+ def test_out_nullable_hash(self):
+ self.assertEqual(None, Everything.test_ghash_null_out())
+
+ def test_out_nullable_list(self):
+ self.assertEqual(None, Everything.test_gslist_null_out())
+ self.assertEqual(None, Everything.test_glist_null_out())
+
+ def test_out_nullable_array(self):
+ self.assertEqual((None, 0), Everything.test_array_int_null_out())
+
+ def test_out_nullable_string(self):
+ self.assertEqual(None, Everything.test_utf8_null_out())
+
class TestCallbacks(unittest.TestCase):
called = False
def testCallback(self):