I have a rather simple QGIS standalone Python app (2.8.2, Windows 7/64), with some published methods to create different types of geometric primitives (rectangles, circles).
class MyApp(QMainWindow, UI_MyApp) def __init__(self, ...) def circle(self, x, y, radius) ... layer.triggerRepaint() ... def run_tests() self.circle(...) self.circle(...) ... def main() ... app = QApplication(sys.argv) map = MyApp() map.show() map.raise_() app.exec_() ...
Now I want to run some automated tests against these methods, in this example circle().
It doesn't matter if I include the test calls inside the class itself (as shown above, e.g. connected with a button in the UI) or kept in a separate module: in both cases all graphics are not drawn until run_tests() finished.
How can I implement a (separate) test module which can call methods of MyApp() application with immediate response after each call and thus acting like an API?