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:

PyPI page:
Ubuntu packages:

Project information

Martin Pitt
Martin Pitt

RDF metadata

View full history Series and milestones

trunk series is the current focus of development.

All code Code

Version control system:
Programming languages:

All packages Packages in Distributions

Get Involved


Latest version is 0.17.1
released on 2018-02-21

All downloads