Merge lp:~veebers/unity/testfix_hudvisuals_workspaces into lp:unity

Proposed by Christopher Lee
Status: Work in progress
Proposed branch: lp:~veebers/unity/testfix_hudvisuals_workspaces
Merge into: lp:unity
Diff against target: 22 lines (+8/-1)
1 file modified
tests/autopilot/unity/tests/test_hud.py (+8/-1)
To merge this branch: bzr merge lp:~veebers/unity/testfix_hudvisuals_workspaces
Reviewer Review Type Date Requested Status
Francis Ginther Abstain
jenkins (community) continuous-integration Disapprove
Thomi Richards (community) Needs Fixing
Review via email: mp+110725@code.launchpad.net

Commit message

Autopilot Hud Tests now check against active app icon, not a hardcoded value.

Description of the change

Problem:
The test test_dash_hud_only_uses_icon_from_current_desktop assumed there would be no apps open on the 2nd workspace (and thus used a hard-coded icon value).

Solution:
Test now checks for the active app and uses that falling back on the originally hard-coded 'launcher_bfb.png' one would find on a blank desktop.

Tests:
Ran the test a couple of times through with different apps open on the 2nd workspace as well as no apps on the 2nd workspace.

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Hi,

I'm afraid this needs fixing - while you've made the test pass, it no longer tests what it says on the tin. The test is supposed to ensure that, when no active applications are found on the current desktop the HUD must use the BFB icon, rather than an application icon.

I suggest making a method in the workspace switcher emulator (in the autopilot codebase) called "move_to_blank_workspace". This method attempts to find a blank workspace and switch to it, or raises a particular exception with the message "No empty workspaces found". We should then use this everywhere where we need a blank workspace.

Does that make sense? Talk to me later if it doesn't.

review: Needs Fixing
Revision history for this message
jenkins (martin-mrazik+qa) wrote :

FAILED: Continuous integration, rev:2419
http://s-jenkins:8080/job/unity-ci/7/

review: Disapprove (continuous-integration)
Revision history for this message
Martin Mrazik (mrazik) wrote :

The jenkins above is a problem in jenkins infrastructure. Please ignore. I'll take care of it.

Revision history for this message
Francis Ginther (fginther) wrote :

Review was claimed by accident, please ignore.

review: Abstain

Unmerged revisions

2419. By Christopher Lee

Test now checks against active apps icon, not hardcoded

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/unity/tests/test_hud.py'
2--- tests/autopilot/unity/tests/test_hud.py 2012-05-31 00:01:22 +0000
3+++ tests/autopilot/unity/tests/test_hud.py 2012-06-18 06:00:29 +0000
4@@ -464,10 +464,17 @@
5 calc = self.start_app("Calculator")
6 self.assertTrue(calc.is_active)
7 self.workspace.switch_to(2)
8+ self.addCleanup(self.workspace.switch_to, 0)
9+ active_app = [a for a in self.bamf.get_running_applications()
10+ if a.is_active]
11+ try:
12+ icon_name = active_app[0].icon
13+ except IndexError:
14+ icon_name = "launcher_bfb.png"
15 self.dash.ensure_visible()
16 self.hud.ensure_visible()
17
18- self.assertThat(self.hud.icon.icon_name, Eventually(EndsWith("launcher_bfb.png")))
19+ self.assertThat(self.hud.icon.icon_name, Eventually(EndsWith(icon_name)))
20
21
22 class HudAlternativeKeybindingTests(HudTestsBase):