(Title was: \"How to write a unit test for a DBUS service written in Python?\")
I\'ve started to write a DBUS service using dbus-python, but I\'m having trouble writ
You could also start the mainloop in a separate thread very simply inside your setUp method.
Something like this:
import threading
class BaseTestCase(unittest.TestCase):
def setUp(self):
myservice = MyDBUSService()
self.loop = gobject.MainLoop()
threading.Thread(name='glib mainloop', target=self.loop.run)
def tearDown(self):
self.loop.quit()