def __init__(self, server_address, RequestHandlerClass, config = None, bind_and_activate = True, cassette = None, request_json_builder = None):
'''
Initialize the test server. TestServer basically subclasses HTTPServer to keep track of the configuration
context, as the base HTTPServer class takes in a class for the handler rather than an instance, and there is no
direct way for the handler to keep the context.
'''
HTTPServer.__init__(self, server_address, RequestHandlerClass, bind_and_activate)
self.config = config
self.cassette = cassette
self.logger = logging.getLogger('test-server')
self.request_json_builder = request_json_builder
评论列表
文章目录