~didrocks/ubuntuone-client/use_result_var

« back to all changes in this revision

Viewing changes to tests/platform/linux/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Rodney Dawes
  • Date: 2011-02-11 16:18:11 UTC
  • mto: This revision was merged to the branch mainline in revision 67.
  • Revision ID: james.westby@ubuntu.com-20110211161811-n18dj9lde7dxqjzr
Tags: upstream-1.5.4
ImportĀ upstreamĀ versionĀ 1.5.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""Linux test code."""
 
2
 
 
3
def _setup_service_busname(testcase):
 
4
    # monkeypatch __del__ to avoid issues with gc
 
5
    import dbus
 
6
    dbus.service.BusName.__del__ = lambda _: None
 
7
 
 
8
setup_action_queue_test = _setup_service_busname
 
9
 
 
10
setup_main_test = _setup_service_busname
 
11
 
 
12
def get_main_params(testcase, params):
 
13
    """Return the parameters used to create the main object for tests."""
 
14
    from dbus.mainloop.glib import DBusGMainLoop
 
15
    # set glib_loop and return the common params
 
16
    params['glib_loop'] = DBusGMainLoop(set_as_default=True)
 
17
    return params