* added damn notworking twill tests
parent
fccfba66d7
commit
9ef218872a
@ -0,0 +1,55 @@
|
||||
import twill
|
||||
import cherrypy
|
||||
import CryptoBoxWebserverSites
|
||||
|
||||
|
||||
class TestIt:
|
||||
'''this will be the testclass of the webserver, using "twill"
|
||||
|
||||
one way to manually run twill code is through the python
|
||||
interpreter commandline e.g.:
|
||||
|
||||
import twill
|
||||
twill.shell.main()
|
||||
go http://localhost:8080
|
||||
find "my very special html content"
|
||||
help
|
||||
'''
|
||||
|
||||
def setUp(self):
|
||||
cherrypy.config.update({
|
||||
'server.logToScreen' : True,
|
||||
'autoreload.on': False,
|
||||
'server.threadPool': 1,
|
||||
'server.environment': 'production',
|
||||
})
|
||||
cherrypy.root = CryptoBoxWebserverSites.CryptoBoxWebserverSites()
|
||||
|
||||
from cherrypy._cpwsgi import wsgiApp
|
||||
twill.add_wsgi_intercept('localhost', 8081, lambda: wsgiApp)
|
||||
|
||||
#output = open("foolog","w")
|
||||
#twill.set_output(output)
|
||||
|
||||
|
||||
def tearDown(self):
|
||||
# remove intercept.
|
||||
twill.remove_wsgi_intercept('localhost', 8081)
|
||||
|
||||
# shut down the cherrypy server.
|
||||
cherrypy.server.stop()
|
||||
|
||||
#output.close()
|
||||
|
||||
def test_01(self):
|
||||
twill.commands.go("http://localhost:8081/")
|
||||
twill.commands.show()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
t = TestIt()
|
||||
t.setUp()
|
||||
t.test_01()
|
||||
t.tearDown()
|
||||
|
||||
|
Loading…
Reference in New Issue