Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #181 (closed task: wontfix)

Opened 14 years ago

Last modified 9 years ago

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 13 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 13 years ago by jorge.vargas

  • Keywords <Default> removed
  • Cc <Default> removed

what exactly is this for? is this really fastdata it seems like the spammer move it there.

comment:3 Changed 13 years ago by fumanchu@…

FWIW, CherryPy? 3 will have dummy request/response objects in the main thread.

comment:4 Changed 12 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

comment:5 Changed 11 years ago by mramm

  • Status changed from new to closed
  • Resolution set to wontfix

We should use webtest for tests, and provide full Request and Response objects in testing.

comment:6 Changed 9 years ago by chrisz

  • Milestone changed from __unclassified__ to 1.1
Note: See TracTickets for help on using tickets.