Permalink
Browse files

Removing obsolete direction and linking to new ones.

  • Loading branch information...
1 parent 290fab7 commit a44804be3a3381aa6999d345f111f194caa3f82d @arowla arowla committed with anandology Apr 8, 2009
Showing with 1 addition and 33 deletions.
  1. +1 −33 testing.md
View
@@ -5,36 +5,4 @@ title: Testing webpy applications
# Testing webpy applications
-Python Paste has a wsgi wrapper that intercepts requests to your application
-and enables you to test for the correct responses/status codes etc. Here's
-a simple example (making sure the helloworld app works correctly).
-
- import web
-
- urls = (
- '/(.*)', 'hello' )
-
- class hello:
- def GET(self, name):
- i = web.input(times=1)
- if not name: name = 'world'
- for c in xrange(int(i.times)):
- web.output('Hello,' + name+'!') # you must use web.output
- # instead of print
-
- #if __name__ == "__main__": web.run(urls) # don't run as usual
-
-
- from paste.fixture import TestApp, TestResponse
- from web import webpyfunc, wsgifunc
-
- middleware = []
- app = wsgifunc(webpyfunc(urls, globals()), *middleware)
- app = TestApp(app)
-
- r = app.get("/")
- assert "Hello" in r
-
-
-You can get the paste modules from http://pythonpaste.org/index.html
-
+See [Testing with Paste and Nose](/cookbook/testing_with_paste_and_nose)

0 comments on commit a44804b

Please sign in to comment.