Add linux powerMonitor tests using python-dbusmock

This commit is contained in:
Thiago de Arruda 2017-12-04 16:52:07 -03:00
parent 897712359f
commit dfd98e3428
4 changed files with 118 additions and 0 deletions

13
script/lib/dbus_mock.py Normal file
View file

@ -0,0 +1,13 @@
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')