Пример #1
0
 def setUp(self):
     self.config = testutil.getconfig()
     self.rfile = StringIO("/testfile.txt\n")
     self.wfile = StringIO()
     self.logfile = testutil.getstringlogger()
     self.handler = testutil.gettestinghandler(self.rfile, self.wfile,
                                               self.config)
     self.server = self.handler.server
     self.proto = GopherProtocol("/testfile.txt\n", self.server,
                                 self.handler, self.rfile, self.wfile,
                                 self.config)
Пример #2
0
 def setUp(self):
     self.config = testutil.getconfig()
     self.rfile = BytesIO(b"/testfile.txt\n")
     self.wfile = BytesIO()
     self.logfile = testutil.getstringlogger()
     self.handler = testutil.gettestinghandler(self.rfile, self.wfile,
                                               self.config)
     self.server = self.handler.server
     self.proto = GopherProtocol("/testfile.txt\n", self.server,
                                 self.handler, self.rfile, self.wfile,
                                 self.config)
Пример #3
0
 def setUp(self):
     self.config = testutil.getconfig()
     self.rfile = StringIO("/testfile.txt\n")
     self.wfile = StringIO()
     self.logfile = testutil.getstringlogger()
     self.logstr = "10.77.77.77 [BaseGopherProtocol/FileHandler]: /testfile.txt\n"
     self.handler = testutil.gettestinghandler(self.rfile, self.wfile,
                                               self.config)
     self.server = self.handler.server
     self.proto = BaseGopherProtocol("/testfile.txt\n", self.server,
                                     self.handler, self.rfile, self.wfile,
                                     self.config)
Пример #4
0
 def setUp(self):
     from pygopherd import testutil
     from pygopherd.protocols.rfc1436 import GopherProtocol
     self.config = testutil.getconfig()
     self.rfile = StringIO("/testfile.txt\n")
     self.wfile = StringIO()
     self.logfile = testutil.getstringlogger()
     self.handler = testutil.gettestinghandler(self.rfile, self.wfile,
                                               self.config)
     self.server = self.handler.server
     self.proto = GopherProtocol("/testfile.txt\n", self.server,
                                 self.handler, self.rfile, self.wfile,
                                 self.config)
     self.config.set("handlers.ZIP.ZIPHandler", "enabled", 'true')
     from pygopherd.handlers import HandlerMultiplexer
     HandlerMultiplexer.handlers = None
     handlerlist = self.config.get("handlers.HandlerMultiplexer", "handlers")
     handlerlist = handlerlist.strip()
     handlerlist = handlerlist[0] + 'ZIP.ZIPHandler, ' + handlerlist[1:]
     self.config.set("handlers.HandlerMultiplexer", "handlers", handlerlist)
Пример #5
0
 def setUp(self):
     from pygopherd import testutil
     from pygopherd.protocols.rfc1436 import GopherProtocol
     self.config = testutil.getconfig()
     self.rfile = StringIO("/testfile.txt\n")
     self.wfile = StringIO()
     self.logfile = testutil.getstringlogger()
     self.handler = testutil.gettestinghandler(self.rfile, self.wfile,
                                               self.config)
     self.server = self.handler.server
     self.proto = GopherProtocol("/testfile.txt\n", self.server,
                                 self.handler, self.rfile, self.wfile,
                                 self.config)
     self.config.set("handlers.ZIP.ZIPHandler", "enabled", 'true')
     from pygopherd.handlers import HandlerMultiplexer
     HandlerMultiplexer.handlers = None
     handlerlist = self.config.get("handlers.HandlerMultiplexer",
                                   "handlers")
     handlerlist = handlerlist.strip()
     handlerlist = handlerlist[0] + 'ZIP.ZIPHandler, ' + handlerlist[1:]
     self.config.set("handlers.HandlerMultiplexer", "handlers", handlerlist)
Пример #6
0
 def setUp(self):
     self.stringfile = StringIO()
     self.config = testutil.getconfig()
     self.stringfile = testutil.getstringlogger()
     GopherExceptions.tracebacks = 0
Пример #7
0
 def setUp(self):
     self.stringfile = StringIO()
     self.config = testutil.getconfig()
     self.stringfile = testutil.getstringlogger()
     GopherExceptions.tracebacks = 0