python-dbusmockpython-dbusmockpython-dbusmockWith 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-builds2012-09-28 08:11:41 UTCPythonActive