"""
testing tools and stubs for tests and debugging
"""
from ZPublisher.HTTPRequest import HTTPRequest
from cStringIO import StringIO

def dummy(kdict, name='dummy'):
    return type(name, (object,), kdict)()

def setHeader(self, a, b):
    self.__dict__.update(locals())

fakerequest = HTTPRequest(StringIO(),
                          dict(SERVER_NAME='dummy', SERVER_PORT='8080'),
                          dummy(dict(setHeader=setHeader, name='Response')))
