@@ -57,14 +57,13 @@ class DashEmulatorTestCase(DashBaseTestCase):
57 self.dash.open_scope, scope_name)
57 self.dash.open_scope, scope_name)
59 self.assertEqual(
59 self.assertEqual(
60− 'No scope found with id unexisting.scope', str(exception))
60+ 'No scope found with id unexisting', str(exception))
61 self.assertFalse(mock_pointer.called)
61 self.assertFalse(mock_pointer.called)
63 def test_open_already_opened_scope(self):
63 def test_open_already_opened_scope(self):
64 scope_id = self._get_current_scope_id()
64 scope_id = self._get_current_scope_id()
65 with mock.patch.object(self.dash, 'pointing_device') as mock_pointer:
65 with mock.patch.object(self.dash, 'pointing_device') as mock_pointer:
66− scope = self.dash.open_scope(self._get_scope_name_from_id(
66+ scope = self.dash.open_scope(scope_id)
69 self.assertFalse(mock_pointer.called)
68 self.assertFalse(mock_pointer.called)
70 self._assert_scope_is_opened(scope, scope_id)
69 self._assert_scope_is_opened(scope, scope_id)
@@ -80,12 +79,11 @@ class DashEmulatorTestCase(DashBaseTestCase):
80 return scope.scopeId
79 return scope.scopeId
82 def test_open_scope_to_the_right(self):
81 def test_open_scope_to_the_right(self):
83− leftmost_scope = self._get_scope_name_from_id(
84− self._get_leftmost_scope_id())
82+ leftmost_scope = self._get_leftmost_scope_id()
85 self.dash.open_scope(leftmost_scope)
83 self.dash.open_scope(leftmost_scope)
87 scope_id = self._get_rightmost_scope_id()
85 scope_id = self._get_rightmost_scope_id()
88− scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
86+ scope = self.dash.open_scope(scope_id)
89 self._assert_scope_is_opened(scope, scope_id)
87 self._assert_scope_is_opened(scope, scope_id)
91 def _get_leftmost_scope_id(self):
89 def _get_leftmost_scope_id(self):
@@ -101,10 +99,6 @@ class DashEmulatorTestCase(DashBaseTestCase):
101 'QQuickItem')[0]
99 'QQuickItem')[0]
102 return item.get_children_by_type('QQuickLoader')
100 return item.get_children_by_type('QQuickLoader')
104− def _get_scope_name_from_id(self, scope_id):
105− if scope_id.endswith('.scope'):
106− return scope_id[:-6]
108 def _get_rightmost_scope_id(self):
102 def _get_rightmost_scope_id(self):
109 scope_loaders = self._get_scope_loaders()
103 scope_loaders = self._get_scope_loaders()
110 rightmost_scope_loader = scope_loaders[0]
104 rightmost_scope_loader = scope_loaders[0]
@@ -114,23 +108,22 @@ class DashEmulatorTestCase(DashBaseTestCase):
114 return rightmost_scope_loader.scopeId
108 return rightmost_scope_loader.scopeId
116 def test_open_scope_to_the_left(self):
110 def test_open_scope_to_the_left(self):
117− rightmost_scope = self._get_scope_name_from_id(
118− self._get_rightmost_scope_id())
111+ rightmost_scope = self._get_rightmost_scope_id()
119 self.dash.open_scope(rightmost_scope)
112 self.dash.open_scope(rightmost_scope)
121 scope_id = self._get_leftmost_scope_id()
114 scope_id = self._get_leftmost_scope_id()
122− scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
115+ scope = self.dash.open_scope(scope_id)
123 self._assert_scope_is_opened(scope, scope_id)
116 self._assert_scope_is_opened(scope, scope_id)
125 def test_open_generic_scope(self):
118 def test_open_generic_scope(self):
126− scope_id = 'home.scope'
119+ scope_id = 'scopes'
127− scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
120+ scope = self.dash.open_scope(scope_id)
128 self._assert_scope_is_opened(scope, scope_id)
121 self._assert_scope_is_opened(scope, scope_id)
129 self.assertIsInstance(scope, dash_emulators.GenericScopeView)
122 self.assertIsInstance(scope, dash_emulators.GenericScopeView)
131 def test_open_applications_scope(self):
124 def test_open_applications_scope(self):
132− scope_id = 'applications.scope'
125+ scope_id = 'clickscope'
133− scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
126+ scope = self.dash.open_scope(scope_id)
134 self._assert_scope_is_opened(scope, scope_id)
127 self._assert_scope_is_opened(scope, scope_id)
135 self.assertIsInstance(scope, dash_emulators.DashApps)
128 self.assertIsInstance(scope, dash_emulators.DashApps)
@@ -141,10 +134,10 @@ class GenericScopeViewEmulatorTestCase(DashBaseTestCase):
141 # Set up the fake scopes before launching unity.
134 # Set up the fake scopes before launching unity.
142 self.useFixture(fixture_setup.FakeScopes())
135 self.useFixture(fixture_setup.FakeScopes())
143 super(GenericScopeViewEmulatorTestCase, self).setUp()
136 super(GenericScopeViewEmulatorTestCase, self).setUp()
144− self.home_scope = self.dash.open_scope('home')
137+ self.generic_scope = self.dash.open_scope('MockScope1')
146 def test_open_preview(self):
139 def test_open_preview(self):
147− preview = self.home_scope.open_preview('0', 'Title.0')
140+ preview = self.generic_scope.open_preview('0', 'Title.0')
148 self.assertIsInstance(preview, dash_emulators.DashPreview)
141 self.assertIsInstance(preview, dash_emulators.DashPreview)
149 self.assertTrue(preview.isCurrent)
142 self.assertTrue(preview.isCurrent)
150 self.assertFalse(preview.showProcessingAction)
143 self.assertFalse(preview.showProcessingAction)
@@ -153,7 +146,7 @@ class GenericScopeViewEmulatorTestCase(DashBaseTestCase):
153 expected_details = dict(
146 expected_details = dict(
154 title='Title', subtitle='Subtitle', description='Description')
147 title='Title', subtitle='Subtitle', description='Description')
156− preview = self.home_scope.open_preview('0', 'Title.0')
149+ preview = self.generic_scope.open_preview('0', 'Title.0')
157 details = preview.get_details()
150 details = preview.get_details()
159 self.assertEqual(expected_details, details)
152 self.assertEqual(expected_details, details)
@@ -170,7 +163,7 @@ class DashAppsEmulatorTestCase(DashBaseTestCase):
170 # Set up the fake scopes before launching unity.
163 # Set up the fake scopes before launching unity.
171 self.useFixture(fixture_setup.FakeScopes())
164 self.useFixture(fixture_setup.FakeScopes())
172 super(DashAppsEmulatorTestCase, self).setUp()
165 super(DashAppsEmulatorTestCase, self).setUp()
173− self.applications_scope = self.dash.open_scope('applications')
166+ self.applications_scope = self.dash.open_scope('clickscope')
175 def test_get_applications_with_unexisting_category(self):
168 def test_get_applications_with_unexisting_category(self):
176 exception = self.assertRaises(
169 exception = self.assertRaises(