Google Groups Home
Help | Sign in
#801: cherrypy._cpwsgi.CPWSGIApp is incompatible with twill 0.9b1
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
CherryPy  
View profile
 More options Mar 24, 3:16 pm
From: CherryPy <t...@cherrypy.org>
Date: Mon, 24 Mar 2008 19:16:55 -0000
Local: Mon, Mar 24 2008 3:16 pm
Subject: [CherryPy] #801: cherrypy._cpwsgi.CPWSGIApp is incompatible with twill 0.9b1

#801: cherrypy._cpwsgi.CPWSGIApp is incompatible with twill 0.9b1
-------------------------------------+------------------------------------- -
 Reporter:  mchapman87...@gmail.com  |       Owner:  rdelon
     Type:  defect                   |      Status:  new  
 Priority:  normal                   |   Milestone:        
Component:  CherryPy code            |    Keywords:        
-------------------------------------+------------------------------------- -
 In trying to write nose/twill unit tests for a CherryPy 3 application, I
 was unable to use cherrypy._cpwsgi.CPWSGIApp as the twill app-creation
 function.  My specific CherryPy application class worked fine as the app-
 creation function.

 Here's a script to demonstrate the problem.
 {{{
 #!/usr/bin/env python
 # encoding: utf-8
 import sys, logging, StringIO, twill, cherrypy
 from twill import commands
 from cherrypy._cpwsgi import CPWSGIApp

 class DemoApp(object):
     @cherrypy.expose
     def index(self, *args, **kw):
         return '''<html><head><title>Test</title></head>
         <body><p>This is a test.</p></body>
         </html>'''

 class TestCase(object):
     def setup(self):
         siteSettings = {'server.environment': 'development',
                         'server.socket_port': 8080, 'log.screen': False}
         cherrypy.config.update(siteSettings)
         wsgi_app = cherrypy.tree.mount(DemoApp(), "/", {})
         cherrypy.engine.start()

         def getApp():
             # return wsgi_app   # This works.
             return CPWSGIApp   # This does not.

         twill.add_wsgi_intercept('localhost', 8080, getApp)
         self.outp = StringIO.StringIO()
         twill.set_output(self.outp)

     def teardown(self):
         twill.remove_wsgi_intercept('localhost', 8080)
         cherrypy.engine.stop()
         logging.debug("Twill output:\n%s" % self.outp.getvalue())

     def test1(self):
         commands.go("http://localhost:8080/index")

 def main():
     logging.basicConfig(level=logging.DEBUG)

     import nose
     logging.debug("sys.platform: %s" % sys.platform)
     logging.debug("Using CherryPy %s, twill %s, nose %s" %
                   (cherrypy.__version__, twill.__version__,
 nose.__version__))
     nose.main(defaultTest=__file__)

 if __name__ == "__main__":
     main()
 }}}

 When run with Python 2.5.2, CherryPy 3.1.0beta3, twill 0.9b1 and nose
 0.10.1 on Mac OS X 10.5.2, this produces a traceback ending in
 {{{
 File ".../lib/python2.5/site-
 packages/CherryPy-3.1b1-py2.5.egg/cherrypy/_cpwsgi.py", line 291, in
 __init__
     self.pipeline.extend(pipeline)
 TypeError: 'function' object is not iterable
 }}}

 The problem was first observed with CherryPy 3.0.2.

--
Ticket URL: <http://www.cherrypy.org/ticket/801>
CherryPy <http://www.cherrypy.org>
CherryPy - a pythonic, object-oriented HTTP framework


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
CherryPy  
View profile
 More options Apr 26, 9:34 pm
From: CherryPy <t...@cherrypy.org>
Date: Sun, 27 Apr 2008 01:34:07 -0000
Local: Sat, Apr 26 2008 9:34 pm
Subject: Re: [CherryPy] #801: cherrypy._cpwsgi.CPWSGIApp is incompatible with twill 0.9b1

#801: cherrypy._cpwsgi.CPWSGIApp is incompatible with twill 0.9b1
-------------------------------------+------------------------------------- -
 Reporter:  mchapman87...@gmail.com  |        Owner:  rdelon
     Type:  defect                   |       Status:  new  
 Priority:  normal                   |    Milestone:        
Component:  CherryPy code            |   Resolution:        
 Keywords:                           |  
-------------------------------------+------------------------------------- -
Comment (by fumanchu):

 I don't see how. It would be nice to have the complete traceback.

--
Ticket URL: <http://www.cherrypy.org/ticket/801>
CherryPy <http://www.cherrypy.org>
CherryPy - a pythonic, object-oriented HTTP framework


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google