Mock D-Bus objects

Registered 2012-09-28 by Martin Pitt

With this program/Python library you can easily create mock objects on D-Bus. This is useful for writing tests for software which talks to D-Bus services such as upower, systemd, ConsoleKit, gnome-session or others, and it is hard (or impossible without root privileges) to set the state of the real services to what you expect in your tests.

When using a local system/session bus, you can do integration testing without needing root privileges or disturbing a running system. The Python API offers some convenience functions like "start_session_bus()" and "start_system_bus()" for this, in a DBusTestCase class (subclass of unittest.TestCase).

You can use this with any programming language, as you can run the mocker as a normal program. The actual setup of the mock (adding objects, methods, properties, etc.) all happen via D-Bus methods on the org.freedesktop.DBus.Mock interface. You just don't have the convenience API that way.

Have a look at the README for more information, examples, and pointers to documentation:
https://gitorious.org/python-dbusmock/python-dbusmock/raw/README.rst

PyPI page: http://pypi.python.org/pypi/python-dbusmock
Ubuntu packages: https://code.launchpad.net/~pitti/+archive/daily-builds

Project information

Maintainer:
Martin Pitt
Driver:
Martin Pitt
Development focus:

trunk series 

lp:python-dbusmock 
Browse the code

Programming Languages:
Python
Licences:
GNU LGPL v3
()

RDF metadata

View full history Series and milestones

python-dbusmock trunk series is the current focus of development

Get Involved

Downloads

Latest version is 0.10.1
released on 2014-01-30

All downloads