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, kwargs)
 
def patch_lightdm_mock (self)
 
def wait_for_unity (self)
 
def get_dash (self)
 
def main_window (self)
 

Public Attributes

 touch
 
 unity_geometry_args
 
 grid_size
 

Detailed Description

A test case base class for the Unity shell tests.

Definition at line 112 of file __init__.py.

Member Function Documentation

def unity8.shell.tests.UnityTestCase.launch_unity (   self,
  kwargs 
)
Launch the unity shell, return a proxy object for it.

Definition at line 256 of file __init__.py.

256  def launch_unity(self, **kwargs):
257  """Launch the unity shell, return a proxy object for it."""
258  binary_path = get_binary_path()
259  lib_path = get_lib_path()
260 
261  logger.info(
262  "Lib path is '%s', binary path is '%s'",
263  lib_path,
264  binary_path
265  )
266 
267  self.patch_lightdm_mock()
268 
269  if self._qml_mock_enabled:
270  self._environment['QML2_IMPORT_PATH'] = (
271  get_qml_import_path_with_mock()
272  )
273 
274  if self._data_dirs_mock_enabled:
275  self._patch_data_dirs()
276 
277  # FIXME: we shouldn't be doing this
278  # $MIR_SOCKET, fallback to $XDG_RUNTIME_DIR/mir_socket and
279  # /tmp/mir_socket as last resort
280  try:
281  os.unlink(
282  os.getenv('MIR_SOCKET',
283  os.path.join(os.getenv('XDG_RUNTIME_DIR', "/tmp"),
284  "mir_socket")))
285  except OSError:
286  pass
287  try:
288  os.unlink("/tmp/mir_socket")
289  except OSError:
290  pass
291 
292  app_proxy = self._launch_unity_with_upstart(
293  binary_path,
294  self.unity_geometry_args,
295  )
296 
297  self._set_proxy(app_proxy)
298 
299  # Ensure that the dash is visible before we return:
300  logger.debug("Unity started, waiting for it to be ready.")
301  self.wait_for_unity()
302  logger.debug("Unity loaded and ready.")
303 
304  if model() == 'Desktop':
305  # On desktop, close the dash because it's opened in a separate
306  # window and it gets in the way.
307  process_helpers.stop_job('unity8-dash')
308 
309  return app_proxy
310 
def launch_unity(self, kwargs)
Definition: __init__.py:256
def _set_proxy(self, proxy)
Definition: __init__.py:366
def _launch_unity_with_upstart(self, binary_path, args)
Definition: __init__.py:311

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