diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_container.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_container.py b/tests/test_container.py index a970fa44..fa1f6411 100644 --- a/tests/test_container.py +++ b/tests/test_container.py @@ -41,6 +41,23 @@ MyContainer.install_child_property(1, 'Dumb Prop', 'Dumb Property for testing purposes', '', gobject.PARAM_READWRITE)) + +class MyAlignment(gtk.Alignment): + + def __init__(self, caption): + self.caption = gtk.Label() + self.caption.set_markup('<b>%s</b>' % gobject.markup_escape_text(caption)) + + gtk.Alignment.__init__(self) + + self.caption.set_parent(self) + + def do_forall(self, include_internals, callback, callback_data): + callback(self.caption, callback_data) + gtk.Alignment.do_forall(self, include_internals, callback, callback_data) + +# FIXME: Why is it needed? +gobject.type_register(MyAlignment) class ContainerTest(unittest.TestCase): @@ -52,5 +69,14 @@ class ContainerTest(unittest.TestCase): obj.child_set_property(label, 'dumb_prop', v) self.assertEqual(v, obj.child_get_property(label, 'dumb_prop')) + def testSuperclassForAll(self): + alignment = MyAlignment('test') + label = gtk.Label('foo') + alignment.add(label) + alignment.show_all() + + self.assert_(label.flags() & gtk.VISIBLE) + self.assert_(alignment.caption.flags() & gtk.VISIBLE) + if __name__ == '__main__': unittest.main() |