Ticket #181 (closed task: wontfix)
Provide better dummy request/response for testing
| Reported by: | kevin | Owned by: | anonymous |
|---|---|---|---|
| Priority: | lowest | Milestone: | 1.1 |
| Component: | FastData | Version: | 0.9a5 |
| Severity: | trivial | Keywords: | |
| Cc: |
Description
From Matthew Clark on the mailing list:
Here is the beginning of a unittest that we have been using. I should move this up to a parent class. Otherwise it needs to be in each unittest --
class DummyResponse:
def __init__(self):
self.headerMap = {}
self.simpleCookie = Cookie.SimpleCookie()
self.version = "1.1"
def purge__(self):
pass
class DummyRequest:
def __init__(self):
self.approot = "/"
self.headerMap = {}
self.browserUrl = "http://testapp/"
self.simpleCookie = Cookie.SimpleCookie()
def purge__(self):
pass
oldrequest = None
oldresponse = None
class QDBInterfaceTest(unittest.TestCase):
def setUp(self):
global oldrequest
global oldresponse
cherrypy.config.update(file="---dev.cfg")
cherrypy.response = DummyResponse()
cherrypy.request = DummyRequest()
def tearDown(self):
cherrypy.request = oldrequest
cherrypy.response = oldresponse
Change History
comment:1 Changed 6 years ago by Main page
- Severity changed from normal to trivial
- Cc <Default> added
- Component changed from TurboGears to FastData
- Priority changed from normal to high
- Version set to 0.9a5
- Milestone changed from 0.9 to 1.1
- Keywords <Default> added
- Type changed from enhancement to task
comment:2 Changed 5 years ago by jorge.vargas
- Cc <Default> removed
- Keywords <Default> removed
what exactly is this for? is this really fastdata it seems like the spammer move it there.
comment:3 Changed 5 years ago by fumanchu@…
FWIW, CherryPy? 3 will have dummy request/response objects in the main thread.
comment:4 Changed 5 years ago by alberto
- Milestone changed from 1.1 to __unclassified__
Batch moved into unclassified from 1.1 to properly track progress on the later
Note: See
TracTickets for help on using
tickets.