From: Jason Hildebrand <jdhildeb@us...> - 2004-12-01 16:59:38
Update of /cvsroot/webware/Webware/WebKit/Tests/Basic/MyContext
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32562/Basic/MyContext
Implemented a framework for testing WebKit end-to-end by using the
built-in http server. The module AppServerTest contains a TestCase base
class which starts/stops the appserver in a separate process, and allows
the test case to check whether certain output produced by the appserver.
(currently this has not been tweaked/tested to run on Win32, but this should
Test cases will probably want to use a client-side web testing framework
(possibly webunit @ http://mechanicalcat.net/tech/webunit) for making
requests and testing responses.
--- NEW FILE: Main.py ---
from WebKit.Page import Page
return 'My Sample Context'
self.writeln('<h1>Welcome to Webware!</h1>')
This is a sample context generated for you and has purposly been kept very simple
to give you something to play with to get yourself started. The code that implements
this page is located in <b>%s</b>.
''' % self.request().serverSidePath())
There are more examples and documentaion in the Webware distribution, which you
can get to from here:<p><ul>
adapterName = self.request().adapterName()
ctxs = self.application().contexts().keys()
ctxs = filter(lambda ctx: ctx!='default', ctxs)
for ctx in ctxs:
self.writeln('<li><a href="%s/%s/">%s</a>' % (adapterName, ctx, ctx))
--- NEW FILE: __init__.py ---
def contextInitialize(appServer, path):
# You could put initialization code here to be executed when
# the context is loaded into WebKit.