Merge lp:~sil2100/unity/autopilot_fix_cmd_locale into lp:unity

Proposed by Łukasz Zemczak
Status: Merged
Approved by: Timo Jyrinki
Approved revision: no longer in the source branch.
Merged at revision: 2882
Proposed branch: lp:~sil2100/unity/autopilot_fix_cmd_locale
Merge into: lp:unity
Diff against target: 44 lines (+5/-3)
1 file modified
tests/autopilot/unity/tests/test_command_lens.py (+5/-3)
To merge this branch: bzr merge lp:~sil2100/unity/autopilot_fix_cmd_locale
Reviewer Review Type Date Requested Status
Timo Jyrinki code Approve
MC Return (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+133203@code.launchpad.net

Commit message

The command lens autopilot tests were failing on non-EN locales, since there is no category with the name "Results" there. Let's use gettext.

Description of the change

- Problem:

test_command_lens test cases fail on non-EN locale.

- Fix:

Locale dependent values should first get translated with a gettext call.

- Tests:

None, autopilot test fix.

To post a comment you must log in.
Revision history for this message
MC Return (mc-return) wrote :

LGTM.

review: Approve
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Works great in Finnish too! :)

review: Approve (code)

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_command_lens.py'
2--- tests/autopilot/unity/tests/test_command_lens.py 2012-05-08 16:13:17 +0000
3+++ tests/autopilot/unity/tests/test_command_lens.py 2012-11-07 09:50:25 +0000
4@@ -14,12 +14,14 @@
5
6 from unity.tests import UnityTestCase
7
8+import gettext
9
10 class CommandLensSearchTests(UnityTestCase):
11 """Test the command lense search bahavior."""
12
13 def setUp(self):
14 super(CommandLensSearchTests, self).setUp()
15+ gettext.install("unity-lens-applications")
16
17 def tearDown(self):
18 self.dash.ensure_hidden()
19@@ -34,7 +36,7 @@
20 self.keyboard.press_and_release("Delete")
21
22 self.assertThat(self.dash.search_string, Eventually(Equals("")))
23- results_category = command_lens.get_category_by_name("Results")
24+ results_category = command_lens.get_category_by_name(_("Results"))
25 self.assertThat(results_category.is_visible, Eventually(Equals(False)))
26
27 def test_results_category_appears(self):
28@@ -44,7 +46,7 @@
29 # lots of apps start with 'a'...
30 self.keyboard.type("a")
31 self.assertThat(self.dash.search_string, Eventually(Equals("a")))
32- results_category = command_lens.get_category_by_name("Results")
33+ results_category = command_lens.get_category_by_name(_("Results"))
34 self.assertThat(results_category.is_visible, Eventually(Equals(True)))
35
36 def test_result_category_actually_contains_results(self):
37@@ -54,7 +56,7 @@
38 # lots of apps start with 'a'...
39 self.keyboard.type("a")
40 self.assertThat(self.dash.search_string, Eventually(Equals("a")))
41- results_category = command_lens.get_category_by_name("Results")
42+ results_category = command_lens.get_category_by_name(_("Results"))
43 results = results_category.get_results()
44 self.assertTrue(results)
45