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

Public Member Functions

def setUpClass
 
def setUp
 
def launch_unity
 
def patch_lightdm_mock
 
def wait_for_unity
 
def get_dash
 
def main_window
 

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 257 of file __init__.py.

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

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