electron/script/lib/dbus_mock.py
2017-12-05 08:33:36 -03:00

13 lines
341 B
Python

from dbusmock import DBusTestCase
import atexit
def cleanup():
DBusTestCase.stop_dbus(DBusTestCase.system_bus_pid)
atexit.register(cleanup)
DBusTestCase.start_system_bus()
# create a mock for "org.freedesktop.login1" using python-dbusmock
# preconfigured template
(logind_mock, logind) = DBusTestCase.spawn_server_template('logind')