blueman
blueman copied to clipboard
Tests
Long way to go, but sooo needed...
I'd really love to add some regression tests (or even complete test sets for single plugins) when fixing some stuff, but the fundamental thing we need to get started with this is some way to simulate bluetooth devices. Maybe there's some way to fake them, maybe even some official BlueZ tool. Otherwise we'll need to mock the org.bluez bus, but that will avoid testing the actual interaction of course...
Any ideas?
disclaimer, I never done anything with tests, but I always found the topic interesting.
I found this very interesting. A follow up I have not watched yet is this one.
Basically they suggest to rewrite the functions so they can operate without needing external input like real bluetooth devices.
@cschramm
I think you could use python-dbusmock for testing, it already has bluez4 and 5 templates
http://www.piware.de/2012/11/python-dbusmock-templates/
Looks promising. Project home is here. Not sure if the BlueZ templates are complete and up-to-date, but we could send some PRs if we need something else. :smiley:
OK, I experimented with dbusmock a little bit and created the tests branch. I'm experiencing strange issues with the dbus socket. Could someone please try running PYTHONPATH=. python blueman/test/plugins/applet/SerialManagerTest.py on the branch to see if he gets "Connection refused" errors from the applet child process as well? It looks like dbus-python creates an abstract socket which dbus fails to connect to. I can connect to the socket from another python process though...
I do see Connection Refused and also noticed blueman-applet fails to start with maximum recursion depth exceeded.
edit: I have an ebuild for python-dbusmock.