python-dbusmock
python-dbusmock copied to clipboard
Add helpers for application testing
I am currently working on adding testing to g-c-c and would also like to streamline the code for g-s-d. For this, I worked on the two classes in these commits, and I was wondering whether it might be feasible to merge at least the X11 helper into dbusmock in some form.
Example of using both:
import os
import sys
import unittest
import dbusmock
BUILDDIR = os.environ.get('BUILDDIR', os.path.join(os.path.dirname(__file__)))
class PanelTestCase(dbusmock.X11SessionTestCase, dbusmock.GTest):
g_test_exe = os.path.join(BUILDDIR, 'test-network-panel')
if __name__ == '__main__':
# avoid writing to stderr
unittest.main(testRunner=unittest.TextTestRunner(stream=sys.stdout, verbosity=2))
Which runs Xvfb, and the system + session busses to execute each of the tests in the binary separately.