Package: hamster-dbus
A dbus interface tohamster-lib.Free software: GPL3Documentation:https://hamster-dbus.readthedocs.org.How to usehamster-dbusprovides two very different but related functionalities.hamster_dbus.objectsprovides several dbus object subclasses that can
be used to export services over dbus that in effect exposehamster-libto over dbus.hamster_dbus.storagecontainsDBusStorewhich can be used as a valid
backend forhamster-libthat can communicate with the objects defined inhamster_dbus.objects. This means any client that supportshamster-libcan use this backend (instead of the default SQLAlchemy one
for example) to easily make their clients use an available dbus service
instead of handling the backend functionality itself via SQLAlchemy.These two aspects are independent of each other but are two opposing sides
(server and client of sorts) of the same medal.On top of this, a primitive example dbus-service executeable
(hamster_dbus_service.py) has been included that can be used to get a
minimal hamster-dbus service running in no time.Testing & CoverageThehamster-dbusproject strives to provide maintainable, well documented
and tested code.  To this end we do provide a basic test suite that is actively
maintained and aims to provide >90% coverage.
Unfortunately we currently lack the insight into glib/dbus best practices with
regards to testing and our currentpytestbased solution does only somewhat
work. The main problem is providing an isolated environment for actual unit
testing (not integration tests).
The way we handle things right now is by providing a dedicated fixture that
launches a separate session bus in a new process that our “objects to be
tested” get hooked into.  While this works most of the time there are two
practical issues here (besides not being proper unit tests):You may see an error like this when running the test suite:[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not \
    been called
[xcb] Aborting, sorry about that.

Whilst we do not really understand whats going on this is most likely due
to the fact that the new spawned session bus process is seperate from the
actual main look.coveragewill report most of the “object” code as untested despite
various tests executing their methods. This may be because those methods are
“shadowed” by the@methoddecorator.  Again, we lack the insight to deal
with this right now.So if you have any hints, pointers or even PRs that can help us improving our
test setup we would be most grateful! Until then we will not be able to
automatically run the test suite on a CI server which greatly limits our QA :(To run the test suite locally, just execute the following within your
virtualenv (aftermake develop):make testSidenote About Testing SignalsSo far we have not managed to establish a proper way of testing signals.
In order to manually check if they are emitted as expected you may use the
following (dbus-monitorneeds to be installed):dbus-monitor "type='signal',sender='org.projecthamster.HamsterDBus',interface='org.projecthamster.HamsterDBus1'CreditsTools used in rendering this package:Cookiecuttercookiecutter-pypackageHistory0.10.0 (2016-04-26)First release on PyPI.