Merge lp:~nataliabidart/software-center/lost-in-translation into lp:software-center

Proposed by Natalia Bidart
Status: Merged
Merged at revision: 3046
Proposed branch: lp:~nataliabidart/software-center/lost-in-translation
Merge into: lp:software-center
Diff against target: 72 lines (+17/-10)
2 files modified
softwarecenter/ui/gtk3/panes/installedpane.py (+1/-1)
tests/gtk3/test_installedpane.py (+16/-9)
To merge this branch: bzr merge lp:~nataliabidart/software-center/lost-in-translation
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Review via email: mp+112109@code.launchpad.net

Commit message

- Pass the missing "self" argument to the super(ish) call.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Looks good, thanks for the fix.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/ui/gtk3/panes/installedpane.py'
2--- softwarecenter/ui/gtk3/panes/installedpane.py 2012-06-18 20:26:49 +0000
3+++ softwarecenter/ui/gtk3/panes/installedpane.py 2012-06-26 13:30:18 +0000
4@@ -690,7 +690,7 @@
5
6 def on_application_selected(self, appview, app):
7 """Callback for when an app is selected."""
8- SoftwarePane.on_application_selected(appview, app)
9+ SoftwarePane.on_application_selected(self, appview, app)
10 self.current_appview_selection = app
11
12 def enter_page(self, page, state):
13
14=== modified file 'tests/gtk3/test_installedpane.py'
15--- tests/gtk3/test_installedpane.py 2012-05-30 18:39:55 +0000
16+++ tests/gtk3/test_installedpane.py 2012-06-26 13:30:18 +0000
17@@ -11,39 +11,46 @@
18
19 class TestInstalledPane(unittest.TestCase):
20
21- def test_installedpane(self):
22+ def setUp(self):
23 win = get_test_window_installedpane()
24 self.addCleanup(win.destroy)
25- installedpane = win.get_data("pane")
26+ self.pane = win.get_data("pane")
27+
28+ def test_installedpane(self):
29 do_events_with_sleep()
30 # safe initial show/hide label for later
31- initial_actionbar_label = installedpane.action_bar._label_text
32+ initial_actionbar_label = self.pane.action_bar._label_text
33 # do simple search
34- installedpane.on_search_terms_changed(None, "foo")
35+ self.pane.on_search_terms_changed(None, "foo")
36 do_events_with_sleep()
37- model = installedpane.app_view.tree_view.get_model()
38+ model = self.pane.app_view.tree_view.get_model()
39 # FIXME: len(model) *only* counts the size of the top level
40 # (category) hits. thats still ok, as non-apps will
41 # add the "system" category
42 len_only_apps = len(model)
43 # set to show nonapps
44- installedpane._show_nonapp_pkgs()
45+ self.pane._show_nonapp_pkgs()
46 do_events_with_sleep()
47 len_with_nonapps = len(model)
48 self.assertTrue(len_with_nonapps > len_only_apps)
49 # set to hide nonapps again and ensure the size matches the
50 # previous one
51- installedpane._hide_nonapp_pkgs()
52+ self.pane._hide_nonapp_pkgs()
53 do_events_with_sleep()
54 self.assertEqual(len(model), len_only_apps)
55 # clear sarch and ensure we get a expanded size again
56- installedpane.on_search_terms_changed(None, "")
57+ self.pane.on_search_terms_changed(None, "")
58 do_events_with_sleep()
59 all_apps = len(model)
60 self.assertTrue(all_apps > len_only_apps)
61 # ensure we have the same show/hide info as initially
62 self.assertEqual(initial_actionbar_label,
63- installedpane.action_bar._label_text)
64+ self.pane.action_bar._label_text)
65+
66+ def test_application_selected(self):
67+ the_app = object()
68+ self.pane.on_application_selected(appview=None, app=the_app)
69+ self.assertIs(self.pane.current_appview_selection, the_app)
70
71
72 if __name__ == "__main__":