Source

CherryPy / test / test_tools.py

The branch 'cp3-wsgi-remix' does not exist.
Diff from to

File test/test_tools.py

             return cherrypy.request.body
         pipe.exposed = True
         pipe._cp_config = {'hooks.before_request_body': pipe_body}
+        
+        # Multiple decorators; include kwargs just for fun.
+        def decorated_euro(self):
+            yield u"Hello,"
+            yield u"world"
+            yield europoundUnicode
+        decorated_euro.exposed = True
+        decorated_euro = tools.gzip(compress_level=6)(decorated_euro)
+        decorated_euro = tools.encode(errors='ignore')(decorated_euro)
     
     root = Root()
     
         
         self.getPage("/euro", headers=[("Accept-Encoding", "gzip")])
         self.assertInBody(zbuf.getvalue()[:3])
+        
+        zbuf = StringIO.StringIO()
+        zfile = gzip.GzipFile(mode='wb', fileobj=zbuf, compresslevel=6)
+        zfile.write(expectedResult)
+        zfile.close()
+        
+        self.getPage("/decorated_euro", headers=[("Accept-Encoding", "gzip")])
+        self.assertInBody(zbuf.getvalue()[:3])
     
     def testBareHooks(self):
         content = "bit of a pain in me gulliver"