summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2020-04-17 18:16:54 +0200
committerChristoph Reiter <reiter.christoph@gmail.com>2020-04-17 18:33:46 +0200
commit1a2bc1d0806ab6178f65125bf0b2283eb3378d4d (patch)
tree245594a7295200a98899ffd17a9b0ca5529a8056 /tests
parent4927856945899de09cfe99c052a83aec6e2f3c1a (diff)
downloadpygobject-1a2bc1d0806ab6178f65125bf0b2283eb3378d4d.tar.gz
get/set_focus_on_click: Fix return value, add a test and document why the override is there
Also make it conditional on the Gtk.Widget method existing since that was only added with gtk 3.20 and we support 3.18+.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_overrides_gtk.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_overrides_gtk.py b/tests/test_overrides_gtk.py
index 8ed9775e..ff3acba9 100644
--- a/tests/test_overrides_gtk.py
+++ b/tests/test_overrides_gtk.py
@@ -2793,3 +2793,11 @@ class TestContainer(unittest.TestCase):
self.assertEqual(expand, False)
self.assertEqual(fill, False)
self.assertEqual(padding, 21)
+
+
+def test_button_focus_on_click():
+ b = Gtk.Button()
+ b.set_focus_on_click(True)
+ assert b.get_focus_on_click()
+ b.set_focus_on_click(False)
+ assert not b.get_focus_on_click()