Merge lp:~jelmer/bzr-gtk/fix-tests into lp:bzr-gtk

Proposed by Jelmer Vernooij on 2016-11-27
Status: Merged
Merged at revision: 797
Proposed branch: lp:~jelmer/bzr-gtk/fix-tests
Merge into: lp:bzr-gtk
Diff against target: 113 lines (+17/-12)
5 files modified
__init__.py (+2/-0)
commit.py (+1/-1)
diff.py (+3/-0)
tests/test_ui.py (+10/-10)
ui.py (+1/-1)
To merge this branch: bzr merge lp:~jelmer/bzr-gtk/fix-tests
Reviewer Review Type Date Requested Status
Vincent Ladeuil 2016-11-27 Approve on 2016-11-27
Bazaar GTK maintainers 2016-11-27 Pending
Review via email: mp+311894@code.launchpad.net

Description of the change

Fix tests on modern Debian systems.

To post a comment you must log in.
Vincent Ladeuil (vila) wrote :

Indeed, on xenial which I'm using right now,

$ bzr selftest -s bp.gtk

fails on trunk but succeeds with your patch so, approving, thanks !

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '__init__.py'
2--- __init__.py 2012-03-16 17:28:20 +0000
3+++ __init__.py 2016-11-27 17:35:27 +0000
4@@ -164,6 +164,8 @@
5 try:
6 result = basic_tests
7 try:
8+ import gi
9+ gi.require_version('Gtk', '3.0')
10 import gi.repository.Gtk
11 except ImportError:
12 return basic_tests
13
14=== modified file 'commit.py'
15--- commit.py 2012-03-22 17:14:22 +0000
16+++ commit.py 2016-11-27 17:35:27 +0000
17@@ -37,7 +37,7 @@
18
19 try:
20 import dbus
21- import dbus.glib
22+ import dbus.mainloop.glib
23 have_dbus = True
24 except ImportError:
25 have_dbus = False
26
27=== modified file 'diff.py'
28--- diff.py 2012-02-05 05:14:11 +0000
29+++ diff.py 2016-11-27 17:35:27 +0000
30@@ -13,6 +13,9 @@
31 import sys
32 import inspect
33
34+import gi
35+gi.require_version('Gtk', '3.0')
36+gi.require_version('GtkSource', '3.0')
37 from gi.repository import Gtk
38 from gi.repository import Pango
39 try:
40
41=== modified file 'tests/test_ui.py'
42--- tests/test_ui.py 2012-02-28 04:53:55 +0000
43+++ tests/test_ui.py 2016-11-27 17:35:27 +0000
44@@ -61,8 +61,8 @@
45 self.assertEqual('test 123', dialog.props.text)
46 self.assertEqual(Gtk.MessageType.QUESTION, dialog.props.message_type)
47 buttons = dialog.get_action_area().get_children()
48- self.assertEqual('gtk-yes', buttons[0].props.label)
49- self.assertEqual('gtk-no', buttons[1].props.label)
50+ self.assertEqual('_No', buttons[0].props.label)
51+ self.assertEqual('_Yes', buttons[1].props.label)
52
53
54 class InfoDialogTestCase(tests.TestCase):
55@@ -73,7 +73,7 @@
56 self.assertEqual('test 123', dialog.props.text)
57 self.assertEqual(Gtk.MessageType.INFO, dialog.props.message_type)
58 buttons = dialog.get_action_area().get_children()
59- self.assertEqual('gtk-close', buttons[0].props.label)
60+ self.assertEqual('_Close', buttons[0].props.label)
61
62
63 class WarningDialogTestCase(tests.TestCase):
64@@ -84,7 +84,7 @@
65 self.assertEqual('test 123', dialog.props.text)
66 self.assertEqual(Gtk.MessageType.WARNING, dialog.props.message_type)
67 buttons = dialog.get_action_area().get_children()
68- self.assertEqual('gtk-close', buttons[0].props.label)
69+ self.assertEqual('_Close', buttons[0].props.label)
70
71
72 class ErrorDialogTestCase(tests.TestCase):
73@@ -95,7 +95,7 @@
74 self.assertEqual('test 123', dialog.props.text)
75 self.assertEqual(Gtk.MessageType.ERROR, dialog.props.message_type)
76 buttons = dialog.get_action_area().get_children()
77- self.assertEqual('gtk-close', buttons[0].props.label)
78+ self.assertEqual('_Close', buttons[0].props.label)
79
80
81 class PasswordDialogTestCase(tests.TestCase):
82@@ -110,13 +110,13 @@
83 self.assertEqual('test password', widgets[0].props.label)
84 self.assertEqual(False, widgets[1].props.visibility)
85 buttons = dialog.get_action_area().get_children()
86- self.assertEqual('gtk-cancel', buttons[0].props.label)
87+ self.assertEqual('gtk-ok', buttons[0].props.label)
88+ self.assertEqual(
89+ Gtk.ResponseType.OK,
90+ dialog.get_response_for_widget(buttons[0]))
91+ self.assertEqual('gtk-cancel', buttons[1].props.label)
92 self.assertEqual(
93 Gtk.ResponseType.CANCEL,
94- dialog.get_response_for_widget(buttons[0]))
95- self.assertEqual('gtk-ok', buttons[1].props.label)
96- self.assertEqual(
97- Gtk.ResponseType.OK,
98 dialog.get_response_for_widget(buttons[1]))
99
100
101
102=== modified file 'ui.py'
103--- ui.py 2012-02-27 21:07:38 +0000
104+++ ui.py 2016-11-27 17:35:27 +0000
105@@ -104,7 +104,7 @@
106 self.finished()
107
108
109-class ProgressContainerMixin:
110+class ProgressContainerMixin(object):
111 """Expose GtkProgressBar methods to a container class."""
112
113 def tick(self, *args, **kwargs):

Subscribers

People subscribed via source and target branches

to all changes: