Merge lp:~osomon/webbrowser-app/fix-ap-activity-view into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 328
Merged at revision: 332
Proposed branch: lp:~osomon/webbrowser-app/fix-ap-activity-view
Merge into: lp:webbrowser-app
Diff against target: 42 lines (+8/-3)
2 files modified
tests/autopilot/webbrowser_app/emulators/browser.py (+6/-1)
tests/autopilot/webbrowser_app/tests/test_tabs.py (+2/-2)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/fix-ap-activity-view
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Omer Akram (community) Approve
Review via email: mp+187038@code.launchpad.net

Commit message

When the activity view cannot be found, return None instead of raising an exception, as that’s what tests expect.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Omer Akram (om26er) wrote :

looks good, just a small comment:

35 Eventually(Not(Is(None))))

Why not just use IsNot

review: Needs Information
Revision history for this message
Olivier Tilloy (osomon) wrote :

> looks good, just a small comment:
>
> 35 Eventually(Not(Is(None))))
>
> Why not just use IsNot

As far as I know there is not IsNot matcher:

    $ python -c "from testtools.matchers import IsNot"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: cannot import name IsNot

Revision history for this message
Omer Akram (om26er) wrote :

woops

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/webbrowser_app/emulators/browser.py'
2--- tests/autopilot/webbrowser_app/emulators/browser.py 2013-08-29 16:28:44 +0000
3+++ tests/autopilot/webbrowser_app/emulators/browser.py 2013-09-23 14:41:28 +0000
4@@ -5,6 +5,8 @@
5 # under the terms of the GNU General Public License version 3, as published
6 # by the Free Software Foundation.
7
8+from autopilot.introspection.dbus import StateNotFoundError
9+
10 from ubuntuuitoolkit import emulators as uitk
11
12
13@@ -69,7 +71,10 @@
14 return listview.get_children()[0].get_children_by_type("Base")
15
16 def get_activity_view(self):
17- return self.select_single("ActivityView")
18+ try:
19+ return self.select_single("ActivityView")
20+ except StateNotFoundError:
21+ return None
22
23 def get_tabslist(self):
24 return self.get_activity_view().select_single("TabsList")
25
26=== modified file 'tests/autopilot/webbrowser_app/tests/test_tabs.py'
27--- tests/autopilot/webbrowser_app/tests/test_tabs.py 2013-08-29 16:28:44 +0000
28+++ tests/autopilot/webbrowser_app/tests/test_tabs.py 2013-09-23 14:41:28 +0000
29@@ -20,11 +20,11 @@
30 """Tests tabs management."""
31
32 def assert_activity_view_eventually_visible(self):
33- self.assertThat(lambda: self.main_window.get_activity_view(),
34+ self.assertThat(self.main_window.get_activity_view,
35 Eventually(Not(Is(None))))
36
37 def assert_activity_view_eventually_hidden(self):
38- self.assertThat(lambda: self.main_window.get_activity_view(),
39+ self.assertThat(self.main_window.get_activity_view,
40 Eventually(Is(None)))
41
42 def ensure_activity_view_visible(self):

Subscribers

People subscribed via source and target branches

to status/vote changes: