After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 321628 - Create unit tests for dogtail (and pyspi?)
Create unit tests for dogtail (and pyspi?)
Status: RESOLVED WONTFIX
Product: dogtail
Classification: Deprecated
Component: Framework
CVS HEAD
Other Linux
: Normal normal
: ---
Assigned To: Dogtail Maintainers
Dogtail Maintainers
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2005-11-16 17:15 UTC by Dave Malcolm
Modified: 2011-02-07 06:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
New file, to go in dogtail/dogtail. (8.64 KB, text/plain)
2006-06-23 13:24 UTC, Dave Malcolm
Details

Description Dave Malcolm 2005-11-16 17:15:50 UTC
Currently we don't have any unit tests for checking that the framework is sane.
 I think we badly need to have these, and we should run them whenever we're
about to commit to CVS, and not commit until the tests pass.

Proposal:  
Create a simple app using pygtk and libglade, which exists purely for the sake
of running unit tests on the dogtail and pyspi API.  It would live in a
subdirectory of the toplevel dogtail directory.  We'd use the standard Python
"unittest" module, in the setup/teardown we'd run the app, we can then have
tests which drive the various methods in the API, checking that searches
succeed, that they fail where they should fail etc etc.

Possible names for the dummy app:
- treestump
- hydrant (too US-specific?)
- lamppost (too UK-specific?)
- tree (No: already taken)

Should the dummy app live in the dogtail module?  
Pros: ensures the visibility of it, makes it easy to run the unit tests
Cons: it could also be useful for writing unit tests for pyspi

Even without pyspi unit tests, if making changes to _pyspi_ I think we should
run the _dogtail_ unit tests and see if anything breaks there (this isn't
strictly doing unit tests for pyspi, but should catch any major breakages);
perhaps we should have proper pyspi unit tests as well.

Thoughts?
Comment 1 Dave Malcolm 2006-06-23 13:22:11 UTC
Much simpler: use gtk-demo, which is shipped with the GTK package (on Fedora, at least, and ought to be by any sane distribution)

I've written the start of some unit tests.  At first I implemented them inline near the code they tested, but decided to move them out into a new file devoted to the tests, based on the advice at the bottom of: http://docs.python.org/lib/organizing-tests.html
Comment 2 Dave Malcolm 2006-06-23 13:24:39 UTC
Created attachment 67894 [details]
New file, to go in dogtail/dogtail. 

Framework for dogtail unit tests, with 36 tests so far,of which about 15 are meaningful, the rest are FIXMEs.
Comment 3 Zack Cerza 2006-06-23 17:20:25 UTC
Odd, I can't see gtk-demo via at-spi.
Comment 4 Zack Cerza 2006-06-23 17:21:25 UTC
Oh yeah; I'm on FC5. Did you write these on rawhide?
Comment 5 Zack Cerza 2006-06-23 18:06:18 UTC
Oh, it looks like on FC5 gtk-demo needs the GTK_MODULES="gail:atk-bridge" hack. Maybe utils.run() should do that for you...
Comment 6 Dave Malcolm 2006-06-27 22:30:12 UTC
I committed a version of the attachment in a new subdirectory as:  tests/Node.py

Further files can be created, containing tests for other classes.

So this is partially working - we don't have great test coverage yet though.
Comment 7 Fabio Durán Verdugo 2011-02-07 06:01:39 UTC
dogtail development has been stalled and it has been unmaintained for a few
years now.
Maintainers don't have future development plan so i am closing bugs as WONTFIX.
Please feel free to reopen the bugs in future if anyone takes the responsibility for active development.