#!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Common testing utilities.
"""


__authors__ = [
  '"Augie Fackler" <durin42@gmail.com>',
  ]


class MockRequest(object):
  """Shared dummy request object to mock common aspects of a request.
  """
  def __init__(self, path=None):
    self.REQUEST = self.GET = self.POST = {}
    self.path = path

@@ -696,9 +696,90 @@
 ,%0A  
-%5D
+'%22Sverre Rabbelier%22 %3Csverre@rabbelier.nl%3E',%0A  %5D%0A%0A%0Afrom soc.modules import callback
 %0A%0A%0Ac
@@ -877,15 +877,147 @@
 est.
+%0A%0A  Before using the object, start should be called, when done (and%0A  before calling start on a new request), end should be called.
 %0A  %22%22%22%0A
+%0A
   de
@@ -1045,16 +1045,179 @@
 =None):%0A
+    %22%22%22Creates a new empty request object.%0A%0A    self.REQUEST, self.GET and self.POST are set to an empty%0A    dictionary, and path to the value specified.%0A    %22%22%22%0A%0A
     self
@@ -1226,16 +1226,23 @@
 EQUEST =
+ %7B%7D%0A   
  self.GE
@@ -1244,16 +1244,23 @@
 lf.GET =
+ %7B%7D%0A   
  self.PO
@@ -1288,8 +1288,271 @@
  = path%0A
+%0A  def start(self):%0A    %22%22%22Readies the core for a new request.%0A    %22%22%22%0A%0A    core = callback.getCore()%0A    core.startNewRequest(self)%0A%0A  def end(self):%0A    %22%22%22Finishes up the current request.%0A    %22%22%22%0A%0A    core = callback.getCore()%0A    core.endRequest(self, False)%0A

Add a start and end method to MockRequest