diff options
author | Simon Feltman <sfeltman@src.gnome.org> | 2012-11-09 19:17:03 -0800 |
---|---|---|
committer | Simon Feltman <sfeltman@src.gnome.org> | 2012-11-11 22:50:14 -0800 |
commit | 7b7277f3cc099280f8e2d6cf6693490290fedc24 (patch) | |
tree | f6adb4a3130314109ce0c81ac230e800f6caf34a /tests/test_properties.py | |
parent | c5343d329ebb452d97afac30e4120ebab8477556 (diff) | |
download | pygobject-7b7277f3cc099280f8e2d6cf6693490290fedc24.tar.gz |
Set Property instance doc string and blurb to getter doc string
Assign Property getter __doc__ strings or explicit blurb parameters
to the Property instances __doc__ attribute. This clobbers the
default Property classes lengthy and unhelpful doc string in the case
of instances.
https://bugzilla.gnome.org/show_bug.cgi?id=688025
Diffstat (limited to 'tests/test_properties.py')
-rw-r--r-- | tests/test_properties.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/test_properties.py b/tests/test_properties.py index 008efc3f..fb290452 100644 --- a/tests/test_properties.py +++ b/tests/test_properties.py @@ -719,14 +719,20 @@ class TestProperty(unittest.TestCase): del t self.assertEqual(sys.getrefcount(o), rc) - def test_doc_string_as_blurb(self): + def test_doc_strings(self): class C(GObject.GObject): + foo_blurbed = GObject.Property(type=int, blurb='foo_blurbed doc string') + @GObject.Property - def blurbed(self): - """blurbed doc string""" + def foo_getter(self): + """foo_getter doc string""" return 0 - self.assertEqual(C.blurbed.blurb, 'blurbed doc string') + self.assertEqual(C.foo_blurbed.blurb, 'foo_blurbed doc string') + self.assertEqual(C.foo_blurbed.__doc__, 'foo_blurbed doc string') + + self.assertEqual(C.foo_getter.blurb, 'foo_getter doc string') + self.assertEqual(C.foo_getter.__doc__, 'foo_getter doc string') def test_python_to_glib_type_mapping(self): tester = GObject.Property() |