← Back to team overview

ubuntu-accomplishments-contributors team mailing list archive

python-dbusmock

 

I think this announcement from pitti might be useful for our unit testing. The daemon is "complete" except for anything that requires dbus. Anyone want to give it a try?

Hello all,

I was working on writing tests for gnome-settings-daemon a week or so
ago, and finally got blocked on being unable to set up
upower/ConsoleKit/etc. the way I need them. Also, doing so needs root
privileges, I don’t want my test suite to actually suspend my machine,
and using the real service is generally not suitable for test suites
that are supposed to run during “make check”, in jhbuild, and the like
— these do not have the polkit privileges to do all that, and may not
even have a system D-Bus running in the first place.

So I wrote a little test_upower.py helper, then realized that I need
another one for systemd/ConsoleKit (for the “system idle” property),
also looked at the mock polkit in udisks and finally sat down for two
days to generalize this and do this properly.

The result is python-dbusmock, I just released the first tarball. With
this you can easily create mock objects on D-Bus from any programming
language with a D-Bus binding, or even from the shell.

See the announcement:

  http://www.piware.de/2012/09/announcing-d-bus-mocker-library/

LP project:  https://launchpad.net/python-dbusmock

Perhaps it's useful for someone else as well.

Thanks,

Martin


--

Matthew (Matt) Fischer
LP: http://launchpad.net/~mfisch
IRC: mfisch