[twill] Passing local html files to twill?
titus at caltech.edu
Thu Feb 16 23:21:45 PST 2006
-> I want to write a twill test function that will
-> a. browser to a given url
-> b. test to see if the page returned is the expected page or not
-> In order to test that the test itself is working correctly, I want to
-> pass sample "known good" and "known bad" html pages to the test
-> function, and see if it passes or fails.
-> I have a directory containing of a bunch of sample html pages. I
-> tried to "browse" to a file in the directory, but it didn't work.
-> How can I pass an html file to twill so that I can use twill's
-> assertion code? Is there a better way to do what I want to do?
-> Thanks for any help you may wish to provide.
'file' URLs should now work. Try grabbing the latest version of twill,
0.8.4a2, in egg format at
or in a .tar.gz package at
and let me know how it works!
The problem was that result objects returned from 'file://' URLs didn't
have a return code. I patched this by assuming that any open that
didn't return an OSError (file not found) was == code 200; let me know
how this assumption stands ;).
More information about the twill