summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2013-12-31 19:42:02 -0800
committerSimon Feltman <sfeltman@src.gnome.org>2013-12-31 19:42:02 -0800
commitcebf5314f195bf4bd6ee19a1da3bbb50c2c9bbd6 (patch)
tree945b934b759823f81116f97646a6d48cebde8c40 /tests
parent28a178e385e32c56910f1c430b370a8872218081 (diff)
downloadpygobject-cebf5314f195bf4bd6ee19a1da3bbb50c2c9bbd6.tar.gz
docs: Move GIArgInfo.get_pytype_hint into gi.docstring
Move the C implementation of pytype hinting into pure Python. Now that doc strings are lazily evaluated we can simplify this tedious bit of C code with Python. This is precursory work for getting return types into function doc strings. https://bugzilla.gnome.org/show_bug.cgi?id=697356
Diffstat (limited to 'tests')
-rw-r--r--tests/test_docstring.py8
-rw-r--r--tests/test_repository.py1
2 files changed, 5 insertions, 4 deletions
diff --git a/tests/test_docstring.py b/tests/test_docstring.py
index 2f176ffc..1cae95cc 100644
--- a/tests/test_docstring.py
+++ b/tests/test_docstring.py
@@ -1,6 +1,7 @@
import unittest
import gi.docstring
+from gi.docstring import _get_pytype_hint
from gi.repository import GIMarshallingTests
from gi.repository import Gio
@@ -25,15 +26,16 @@ class Test(unittest.TestCase):
in_args, out_args = gi.docstring.split_function_info_args(GIMarshallingTests.int_out_out)
self.assertEqual(len(in_args), 0)
self.assertEqual(len(out_args), 2)
- self.assertEqual(out_args[0].get_pytype_hint(), 'int')
- self.assertEqual(out_args[1].get_pytype_hint(), 'int')
+ self.assertEqual(_get_pytype_hint(out_args[0].get_type()), 'int')
+ self.assertEqual(_get_pytype_hint(out_args[1].get_type()), 'int')
def test_split_args_inout(self):
in_args, out_args = gi.docstring.split_function_info_args(GIMarshallingTests.long_inout_max_min)
self.assertEqual(len(in_args), 1)
self.assertEqual(len(out_args), 1)
self.assertEqual(in_args[0].get_name(), out_args[0].get_name())
- self.assertEqual(in_args[0].get_pytype_hint(), out_args[0].get_pytype_hint())
+ self.assertEqual(_get_pytype_hint(in_args[0].get_type()),
+ _get_pytype_hint(out_args[0].get_type()))
def test_split_args_none(self):
obj = GIMarshallingTests.Object(int=33)
diff --git a/tests/test_repository.py b/tests/test_repository.py
index 6fd79062..20602ba1 100644
--- a/tests/test_repository.py
+++ b/tests/test_repository.py
@@ -61,7 +61,6 @@ class Test(unittest.TestCase):
self.assertEqual(arg.get_direction(), GIRepository.Direction.OUT)
self.assertEqual(arg.get_name(), 'structs')
self.assertEqual(arg.get_namespace(), 'GIMarshallingTests')
- self.assertEqual(arg.get_pytype_hint(), 'list')
self.assertFalse(arg.is_caller_allocates())
self.assertFalse(arg.is_optional())
self.assertFalse(arg.is_return_value())