Source

CherryPy / cherrypy / test / test_wsgi_ns.py

Diff from to

File cherrypy/test/test_wsgi_ns.py

 import cherrypy
+from cherrypy._cpcompat import ntob
 from cherrypy.test import helper
 
 
             
             def next(self):
                 return self.iter.next()
+            def __next__(self):
+                return next(self.iter)
             
             def close(self):
                 if hasattr(self.appresults, "close"):
                 class CaseResults(WSGIResponse):
                     def next(this):
                         return getattr(this.iter.next(), self.to)()
+                    def __next__(this):
+                        return getattr(next(this.iter), self.to)()
                 return CaseResults(res)
         
         class Replacer(object):
                         for k, v in self.map.iteritems():
                             line = line.replace(k, v)
                         return line
+                    def __next__(this):
+                        line = next(this.iter)
+                        for k, v in self.map.items():
+                            line = line.replace(k, v)
+                        return line
                 return ReplaceResults(res)
         
         class Root(object):
         
         
         root_conf = {'wsgi.pipeline': [('replace', Replacer)],
-                     'wsgi.replace.map': {'L': 'X', 'l': 'r'},
+                     'wsgi.replace.map': {ntob('L'): ntob('X'),
+                                          ntob('l'): ntob('r')},
                      }
         
         app = cherrypy.Application(Root())