Unity 8
unity8.shell.tests.UnityTestCase Class Reference
Inheritance diagram for unity8.shell.tests.UnityTestCase:

Public Member Functions

def setUpClass (cls)
 
def setUp (self)
 
def launch_unity (self, mode="full-greeter", args)
 
def patch_lightdm_mock (self)
 
def wait_for_unity (self)
 
def get_dash (self)
 
def main_window (self)
 

Public Attributes

 unity_geometry_args
 
 grid_size
 

Detailed Description

A test case base class for the Unity shell tests.

Definition at line 88 of file __init__.py.

Member Function Documentation

def unity8.shell.tests.UnityTestCase.launch_unity (   self,
  mode = "full-greeter",
  args 
)
    Launch the unity shell, return a proxy object for it.

:param str mode: The type of greeter/shell mode to use
:param args: A list of aguments to pass to unity8

Definition at line 180 of file __init__.py.

180  def launch_unity(self, mode="full-greeter", *args):
181  """
182  Launch the unity shell, return a proxy object for it.
183 
184  :param str mode: The type of greeter/shell mode to use
185  :param args: A list of aguments to pass to unity8
186 
187  """
188  binary_path = get_binary_path()
189  lib_path = get_lib_path()
190 
191  logger.info(
192  "Lib path is '%s', binary path is '%s'",
193  lib_path,
194  binary_path
195  )
196 
197  self.patch_lightdm_mock()
198 
199  if self._qml_mock_enabled:
200  self._environment['QML2_IMPORT_PATH'] = (
201  get_qml_import_path_with_mock()
202  )
203 
204  if self._data_dirs_mock_enabled:
205  self._patch_data_dirs()
206 
207  unity8_cli_args_list = ["--mode={}".format(mode)]
208  if len(args) != 0:
209  unity8_cli_args_list += args
210 
211  app_proxy = self._launch_unity_with_upstart(
212  binary_path,
213  self.unity_geometry_args + unity8_cli_args_list
214  )
215 
216  self._set_proxy(app_proxy)
217 
218  # Ensure that the dash is visible before we return:
219  logger.debug("Unity started, waiting for it to be ready.")
220  self.wait_for_unity()
221  logger.debug("Unity loaded and ready.")
222 
223  if model() == 'Desktop':
224  # On desktop, close the dash because it's opened in a separate
225  # window and it gets in the way.
226  process_helpers.stop_job('unity8-dash')
227 
228  return app_proxy
229 
def launch_unity(self, mode="full-greeter", args)
Definition: __init__.py:180
def _set_proxy(self, proxy)
Definition: __init__.py:274
def _launch_unity_with_upstart(self, binary_path, args)
Definition: __init__.py:230

The documentation for this class was generated from the following file: