~alecu/ubuntuone-client/config-notifications-2

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Manuel de la Pena
  • Date: 2011-02-08 20:15:54 UTC
  • mfrom: (796.5.26 fix_runner)
  • Revision ID: tarmac-20110208201554-v8mptkasbj5vzma3
Allow tests to be ran on windows even if they fail.

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