diff options
| author | Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com> | 2012-11-23 16:15:07 +0000 |
|---|---|---|
| committer | Tarmac <> | 2012-11-23 16:15:07 +0000 |
| commit | 8efa3a1a4a33df0ddbbacd70beb327bc7b9dad08 (patch) | |
| tree | 95a9900fddc244a14438300494d3a368d9847db5 /tests | |
| parent | 6c65c68f5ca1e015a5c9661295d335f3e181f694 (diff) | |
| parent | 7ddcb106c18ece5f8f3677ce0a57eef21b4c3eab (diff) | |
Actually, for locale independency we need to encapsulate all category strings, and install different domains, depending on which lens is used. We also need to use unicode=True, otherwise it's just a waste of time.
Approved by Marco Trevisan (Treviño). (bzr r2927)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/autopilot/unity/tests/test_dash.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/autopilot/unity/tests/test_dash.py b/tests/autopilot/unity/tests/test_dash.py index acf887197..70d8eba65 100644 --- a/tests/autopilot/unity/tests/test_dash.py +++ b/tests/autopilot/unity/tests/test_dash.py @@ -26,7 +26,6 @@ class DashTestCase(UnityTestCase): # On shutdown, ensure hidden too. Also add a delay. Cleanup is LIFO. self.addCleanup(self.dash.ensure_hidden) self.addCleanup(sleep, 1) - gettext.install("unity-lens-files") class DashRevealTests(DashTestCase): @@ -532,11 +531,12 @@ class DashLensResultsTests(DashTestCase): def test_results_update_on_filter_changed(self): """This test makes sure the results change when filters change.""" + gettext.install("unity-lens-applications") self.dash.reveal_application_lens() lens = self.dash.get_current_lens() self.keyboard.type(" ") self.assertThat(self.dash.search_string, Eventually(Equals(" "))) - results_category = lens.get_category_by_name("Installed") + results_category = lens.get_category_by_name(_("Installed")) old_results = results_category.get_results() # FIXME: This should be a method on the dash emulator perhaps, or @@ -571,7 +571,7 @@ class DashLensResultsTests(DashTestCase): activate_filter(True) self.addCleanup(activate_filter) - results_category = lens.get_category_by_name("Installed") + results_category = lens.get_category_by_name(_("Installed")) results = results_category.get_results() self.assertIsNot(results, old_results) @@ -664,6 +664,7 @@ class CategoryHeaderTests(DashTestCase): """Clicking into a category highlight must expand/collapse the view. """ + gettext.install("unity-lens-applications", unicode=True) lens = self.dash.reveal_application_lens() self.addCleanup(self.dash.ensure_hidden) @@ -689,10 +690,11 @@ class PreviewInvocationTests(DashTestCase): its preview. """ + gettext.install("unity-lens-applications", unicode=True) lens = self.dash.reveal_application_lens() self.addCleanup(self.dash.ensure_hidden) - category = lens.get_category_by_name("More suggestions") + category = lens.get_category_by_name(_("More suggestions")) results = category.get_results() result = results[0] # result.preview handles finding xy co-ords and right mouse-click @@ -707,10 +709,11 @@ class PreviewInvocationTests(DashTestCase): """Right-clicking on a files lens result must show its preview. """ + gettext.install("unity-lens-files", unicode=True) lens = self.dash.reveal_file_lens() self.addCleanup(self.dash.ensure_hidden) - category = lens.get_category_by_name("Folders") + category = lens.get_category_by_name(_("Folders")) results = category.get_results() result = results[0] # result.preview handles finding xy co-ords and right mouse-click @@ -749,9 +752,10 @@ class PreviewInvocationTests(DashTestCase): """Right-clicking on a video lens result must show its preview. """ + gettext.install("unity-lens-video", unicode=True) def get_category(lens): - category = lens.get_category_by_name("Recently Viewed") + category = lens.get_category_by_name(_("Recently Viewed")) # If there was no video played on this system this category is expected # to be empty, if its empty we check if the 'Online' category have any # contents, if not then we skip the test. @@ -782,10 +786,11 @@ class PreviewInvocationTests(DashTestCase): """Pressing menu key on a selected dash result must show its preview. """ + gettext.install("unity-lens-applications", unicode=True) lens = self.dash.reveal_application_lens() self.addCleanup(self.dash.ensure_hidden) - category = lens.get_category_by_name("More suggestions") + category = lens.get_category_by_name(_("More suggestions")) results = category.get_results() result = results[0] # result.preview_key() handles finding xy co-ords and key press @@ -798,11 +803,12 @@ class PreviewNavigateTests(DashTestCase): def setUp(self): super(PreviewNavigateTests, self).setUp() + gettext.install("unity-lens-applications", unicode=True) lens = self.dash.reveal_application_lens() self.addCleanup(self.dash.ensure_hidden) - results_category = lens.get_category_by_name("More suggestions") + results_category = lens.get_category_by_name(_("More suggestions")) # wait for results (we need 4 results to perorm the multi-navigation tests) refresh_fn = lambda: len(results_category.get_results()) self.assertThat(refresh_fn, Eventually(GreaterThan(4))) |
