On Fri, Oct 21, 2011 at 1:22 AM, ne1uno <eltro...@gmail.com> wrote:
> pyqt partially wraps QTest
> with QTest you can activate buttons, fill in text fields etc.
> see an example here:
> http://www.voom.net/pyqt-qtest-example

Thanks for this.  A quick look leads to this test file:

https://voom.kilnhg.com/Repo/Make-Stuff-Happen/Group/PyQtTestExample/File/src/MargaritaMixerTest.py?rev=tip

And a quick glance at the test files shows:

1. class MargaritaMixerTest(unittest.TestCase):

This can readily be adapted to Leo's testing framework.

2. def setUp(self):
        '''Create the GUI'''
        self.app = QApplication(sys.argv)
        self.form = MargaritaMixer.MargaritaMixer()

This will require a bit of wrapping.  Presumably, we want to execute
this in a separate process, so as not to interfere with the
QApplication that is running unitTest.leo.

3.   The rest of the unit tests.  These use various QTest methods, for example::

    QTest.mouseClick(okWidget, Qt.LeftButton)

to simulate user actions and to get results.

Conclusions
=========

All in all, it looks useful.  To make this work with Leo, leoTest.py
would have to define a framework, similar to the existing external
test framework, but set up to run a QApplication in a separate process
rather than leoBridge.  And not just any QApplication, we want to run
(parts of?) Leo itself.  It will be interesting to play with this.

Many thanks for this link.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to leo-editor@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to