Robert Brewer avatar Robert Brewer committed 03da9e5

Fixed line endings in test_wsgi_ns.py.

Comments (0)

Files changed (1)

cherrypy/test/test_wsgi_ns.py

-from cherrypy.test import test
-test.prefer_parent_path()
-
+from cherrypy.test import test
+test.prefer_parent_path()
 
-def setup_server():
-    
-    import cherrypy
-    
+
+def setup_server():
     
-    class ChangeCase(object):
-        
-        def __init__(self, app, to=None):
-            self.app = app
-            self.to = to
-        
-        def __call__(self, environ, start_response):
-            res = ''.join(self.app(environ, start_response))
-            return [getattr(res, self.to)()]
-    
-    def replace(app, map={}):
-        def replace_app(environ, start_response):
-            for line in app(environ, start_response):
-                for k, v in map.iteritems():
-                    line = line.replace(k, v)
-                yield line
-        return replace_app
-    
-    class Root(object):
-        
-        def index(self):
-            return "HellO WoRlD!"
-        index.exposed = True
-    
-    
-    root_conf = {'wsgi.pipeline': [('replace', replace)],
-                 'wsgi.replace.map': {'L': 'X', 'l': 'r'},
-                 }
-    
-    cherrypy.config.update({'environment': 'test_suite'})
-    
-    app = cherrypy.Application(Root())
-    p = cherrypy.wsgi.pipeline(app, [('changecase', ChangeCase)])
-    p.config['changecase'] = {'to': 'upper'}
-    cherrypy.tree.mount(app, config={'/': root_conf})
-    
-    # If we do not supply any middleware in code, pipeline is much cleaner:
-    # app = cherrypy.Application(Root())
-    # cherrypy.wsgi.pipeline(app)
-    # cherrypy.tree.mount(app, config={'/': root_conf})
-
-
-from cherrypy.test import helper
-
-
-class WSGI_Namespace_Test(helper.CPWebCase):
-    
-    def test_pipeline(self):
-        self.getPage("/")
-        # If body is "HEXXO WORXD!", the middleware was applied out of order.
-        self.assertBody("HERRO WORRD!")
-
-if __name__ == '__main__':
-    setup_server()
-    helper.testmain()
-
+    import cherrypy
+    
+    
+    class ChangeCase(object):
+        
+        def __init__(self, app, to=None):
+            self.app = app
+            self.to = to
+        
+        def __call__(self, environ, start_response):
+            res = ''.join(self.app(environ, start_response))
+            return [getattr(res, self.to)()]
+    
+    def replace(app, map={}):
+        def replace_app(environ, start_response):
+            for line in app(environ, start_response):
+                for k, v in map.iteritems():
+                    line = line.replace(k, v)
+                yield line
+        return replace_app
+    
+    class Root(object):
+        
+        def index(self):
+            return "HellO WoRlD!"
+        index.exposed = True
+    
+    
+    root_conf = {'wsgi.pipeline': [('replace', replace)],
+                 'wsgi.replace.map': {'L': 'X', 'l': 'r'},
+                 }
+    
+    cherrypy.config.update({'environment': 'test_suite'})
+    
+    app = cherrypy.Application(Root())
+    p = cherrypy.wsgi.pipeline(app, [('changecase', ChangeCase)])
+    p.config['changecase'] = {'to': 'upper'}
+    cherrypy.tree.mount(app, config={'/': root_conf})
+    
+    # If we do not supply any middleware in code, pipeline is much cleaner:
+    # app = cherrypy.Application(Root())
+    # cherrypy.wsgi.pipeline(app)
+    # cherrypy.tree.mount(app, config={'/': root_conf})
+
+
+from cherrypy.test import helper
+
+
+class WSGI_Namespace_Test(helper.CPWebCase):
+    
+    def test_pipeline(self):
+        self.getPage("/")
+        # If body is "HEXXO WORXD!", the middleware was applied out of order.
+        self.assertBody("HERRO WORRD!")
+
+if __name__ == '__main__':
+    setup_server()
+    helper.testmain()
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.