[pygobject] tests: Add failing tests for GObject sub-class doc-strings
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] tests: Add failing tests for GObject sub-class doc-strings
- Date: Sun, 17 Aug 2014 01:04:51 +0000 (UTC)
commit 4cdca4328da7442be247e775294fc676cf677bb7
Author: Piotr Iwaniuk <piwaniuk poczta onet pl>
Date: Sat Aug 16 15:06:40 2014 -0700
tests: Add failing tests for GObject sub-class doc-strings
Add tests for sub-class docstrings set with either doc-string
syntax and by setting the __doc__ attribute directly.
Co-Authored-By: Simon Feltman <sfeltman src gnome org>
https://bugzilla.gnome.org/show_bug.cgi?id=731452
tests/test_docstring.py | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/tests/test_docstring.py b/tests/test_docstring.py
index a46d2e6..307e89f 100644
--- a/tests/test_docstring.py
+++ b/tests/test_docstring.py
@@ -1,8 +1,10 @@
import unittest
import gi.docstring
+
from gi.repository import GIMarshallingTests
from gi.repository import Gio
+from gi.repository import GObject
try:
import cairo
@@ -84,3 +86,40 @@ class Test(unittest.TestCase):
# Test the 'iter' out argument does not effect length argument skipping.
self.assertEqual(Gtk.ListStore.insert_with_valuesv.__doc__,
'insert_with_valuesv(self, position:int, columns:list, values:list) ->
iter:Gtk.TreeIter')
+
+ @unittest.expectedFailure # https://bugzilla.gnome.org/show_bug.cgi?id=731452
+ def test_sub_class_doc(self):
+ class A(GObject.Object):
+ """first doc"""
+ pass
+
+ class B(A):
+ """second doc"""
+ pass
+
+ self.assertEqual(A.__doc__, "first doc")
+ self.assertEqual(B.__doc__, "second doc")
+
+ @unittest.expectedFailure # https://bugzilla.gnome.org/show_bug.cgi?id=731452
+ def test_sub_class_no_doc(self):
+ class A(GObject.Object):
+ pass
+
+ class B(A):
+ """sub-class doc"""
+
+ self.assertEqual(A.__doc__, None)
+ self.assertEqual(B.__doc__, "sub-class doc")
+
+ @unittest.expectedFailure # https://bugzilla.gnome.org/show_bug.cgi?id=734926
+ def test_sub_class_doc_setattr(self):
+ class A(GObject.Object):
+ pass
+
+ class B(A):
+ pass
+
+ A.__doc__ = 'custom doc'
+
+ self.assertEqual(A.__doc__, "custom doc")
+ self.assertEqual(B.__doc__, "custom doc")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]