# Path: pygopherd/protocols/rfc1436.py
# class GopherProtocol(BaseGopherProtocol):
#     """Implementation of basic protocol.  Will handle every query."""
#     def canhandlerequest(self):
#         if len(self.requestlist) > 1:
#             self.searchrequest = self.requestlist[1]
#         return 1
# 
#     def renderobjinfo(self, entry):
#         #print entry.gettype(), entry.getname(), entry.getselector(), \
#         #      entry.gethost(), entry.getport(), entry.getgopherpsupport()
#         retval = entry.gettype('0') + \
#                  entry.getname() + "\t" + \
#                  entry.getselector() + "\t" + \
#                  entry.gethost(default = self.server.server_name) + "\t" + \
#                  str(entry.getport(default = self.server.server_port))
#         if entry.getgopherpsupport():
#             return retval + "\t+\r\n"
#         else:
#             return retval + "\r\n"
# 
# Path: pygopherd/testutil.py
# def getconfig():
# def getstringlogger():
# def gettestingserver(config = None):
# def gettestinghandler(rfile, wfile, config = None):
#         def __init__(self, rfile, wfile):
#         def makefile(self, mode, bufsize):
#         def __init__(self, request, client_address, server):
# def gettestingprotocol(request, config = None):
#     class requestClass:
#     class handlerClass(initialization.GopherRequestHandler):


import unittest, re
from pygopherd.protocols.rfc1436 import GopherProtocol
from pygopherd import testutil
from io import BytesIO
        from pygopherd.handlers import HandlerMultiplexer

class RFC1436TestCase(unittest.TestCase):
    def setUp(self):
        self.config = testutil.getconfig()
        self.rfile = BytesIO(b"/testfile.txt\n")
        self.wfile = BytesIO()
        self.logfile = testutil.getstringlogger()

# Path: pygopherd/protocols/rfc1436.py
# class GopherProtocol(BaseGopherProtocol):
#     """Implementation of basic protocol.  Will handle every query."""
#     def canhandlerequest(self):
#         if len(self.requestlist) > 1:
#             self.searchrequest = self.requestlist[1]
#         return 1
# 
#     def renderobjinfo(self, entry):
#         #print entry.gettype(), entry.getname(), entry.getselector(), \
#         #      entry.gethost(), entry.getport(), entry.getgopherpsupport()
#         retval = entry.gettype('0') + \
#                  entry.getname() + "\t" + \
#                  entry.getselector() + "\t" + \
#                  entry.gethost(default = self.server.server_name) + "\t" + \
#                  str(entry.getport(default = self.server.server_port))
#         if entry.getgopherpsupport():
#             return retval + "\t+\r\n"
#         else:
#             return retval + "\r\n"
# 
# Path: pygopherd/testutil.py
# def getconfig():
# def getstringlogger():
# def gettestingserver(config = None):
# def gettestinghandler(rfile, wfile, config = None):
#         def __init__(self, rfile, wfile):
#         def makefile(self, mode, bufsize):
#         def __init__(self, request, client_address, server):
# def gettestingprotocol(request, config = None):
#     class requestClass:
#     class handlerClass(initialization.GopherRequestHandler):


# Path: pygopherd/protocols/rfc1436Test.py
import unittest, re
from pygopherd.protocols.rfc1436 import GopherProtocol
from pygopherd import testutil
from io import BytesIO
        from pygopherd.handlers import HandlerMultiplexer


class RFC1436TestCase(unittest.TestCase):
    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,