on xenial help sign in
Updated DashEmulatorTestCase.
commit40453ed338521f1e63e6d8f51880a5ffce77a6af authorLeo Arias <leo.arias@canonical.com> dateSat 1 Mar 2014, 23:26 (13 years ago) parent80d0c90
2 files changed+11−18
tests/autopilot/unity8/shell/emulators/dash.py+3−4 tests/autopilot/unity8/shell/tests/test_emulators.py+8−14
tests/autopilot/unity8/shell/emulators/dash.py+3−4
@@ -59,14 +59,13 @@ class Dash(emulators.UnityEmulatorBase):
5959 'QQuickLoader', scopeId=scope_name)
6060
6161 @autopilot_logging.log_action(logger.info)
62− def open_scope(self, scope_name):
62+ def open_scope(self, scope_id):
6363 """Open a dash scope.
6464
65− :parameter scope_name: The name of the scope.
65+ :parameter scope_id: The id of the scope.
6666 :return: The scope.
6767
6868 """
69− scope_id = "%s.scope" % scope_name
7069 scope_loader = self._get_scope_loader(scope_id)
7170 if scope_loader.isCurrent:
7271 logger.info('The scope is already open.')
@@ -83,7 +82,7 @@ class Dash(emulators.UnityEmulatorBase):
8382 'No scope found with id {0}'.format(scope_id))
8483
8584 def _get_scope_from_loader(self, loader):
86− if loader.scopeId == 'applications.scope':
85+ if loader.scopeId == 'clickscope':
8786 return loader.select_single(DashApps)
8887 else:
8988 return loader.select_single(GenericScopeView)
tests/autopilot/unity8/shell/tests/test_emulators.py+8−14
@@ -63,8 +63,7 @@ class DashEmulatorTestCase(DashBaseTestCase):
6363 def test_open_already_opened_scope(self):
6464 scope_id = self._get_current_scope_id()
6565 with mock.patch.object(self.dash, 'pointing_device') as mock_pointer:
66− scope = self.dash.open_scope(self._get_scope_name_from_id(
67− scope_id))
66+ scope = self.dash.open_scope(scope_id)
6867
6968 self.assertFalse(mock_pointer.called)
7069 self._assert_scope_is_opened(scope, scope_id)
@@ -85,7 +84,7 @@ class DashEmulatorTestCase(DashBaseTestCase):
8584 self.dash.open_scope(leftmost_scope)
8685
8786 scope_id = self._get_rightmost_scope_id()
88− scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
87+ scope = self.dash.open_scope(scope_id)
8988 self._assert_scope_is_opened(scope, scope_id)
9089
9190 def _get_leftmost_scope_id(self):
@@ -101,10 +100,6 @@ class DashEmulatorTestCase(DashBaseTestCase):
101100 'QQuickItem')[0]
102101 return item.get_children_by_type('QQuickLoader')
103102
104− def _get_scope_name_from_id(self, scope_id):
105− if scope_id.endswith('.scope'):
106− return scope_id[:-6]
107−
108103 def _get_rightmost_scope_id(self):
109104 scope_loaders = self._get_scope_loaders()
110105 rightmost_scope_loader = scope_loaders[0]
@@ -114,23 +109,22 @@ class DashEmulatorTestCase(DashBaseTestCase):
114109 return rightmost_scope_loader.scopeId
115110
116111 def test_open_scope_to_the_left(self):
117− rightmost_scope = self._get_scope_name_from_id(
118− self._get_rightmost_scope_id())
112+ rightmost_scope = self._get_rightmost_scope_id()
119113 self.dash.open_scope(rightmost_scope)
120114
121115 scope_id = self._get_leftmost_scope_id()
122− scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
116+ scope = self.dash.open_scope(scope_id)
123117 self._assert_scope_is_opened(scope, scope_id)
124118
125119 def test_open_generic_scope(self):
126− scope_id = 'home.scope'
127− scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
120+ scope_id = 'scopes'
121+ scope = self.dash.open_scope(scope_id)
128122 self._assert_scope_is_opened(scope, scope_id)
129123 self.assertIsInstance(scope, dash_emulators.GenericScopeView)
130124
131125 def test_open_applications_scope(self):
132− scope_id = 'applications.scope'
133− scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
126+ scope_id = 'clickscope'
127+ scope = self.dash.open_scope(scope_id)
134128 self._assert_scope_is_opened(scope, scope_id)
135129 self.assertIsInstance(scope, dash_emulators.DashApps)
136130