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

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

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