Ejemplo n.º 1
0
 def testinitconffile(self):
     self.assertRaises(Exception, initialization.initconffile, '/foo')
     # Load the standard config file.  It should be OK at least.
     config = initialization.initconffile('conf/pygopherd.conf')
     assert not config.has_option("pygopherd", "servername"), \
            "servername should be disabled by default"
     self.assertEqual(config.getint("pygopherd", "port"), 70,
                      "Port should be 70")
     self.assertEqual(config.get("pygopherd",
                                 "servertype"), "ForkingTCPServer",
                      "Servertype should be ForkingTCPServer")
     assert config.getboolean("pygopherd", "tracebacks"), \
            "Tracebacks should be enabled."
Ejemplo n.º 2
0
 def testinitconffile(self):
     self.assertRaises(Exception, initialization.initconffile,
                       '/foo')
     # Load the standard config file.  It should be OK at least.
     config = initialization.initconffile('conf/pygopherd.conf')
     assert not config.has_option("pygopherd", "servername"), \
            "servername should be disabled by default"
     self.assertEqual(config.getint("pygopherd", "port"), 70,
            "Port should be 70")
     self.assertEqual(config.get("pygopherd", "servertype"),
                      "ForkingTCPServer",
                      "Servertype should be ForkingTCPServer")
     assert config.getboolean("pygopherd", "tracebacks"), \
            "Tracebacks should be enabled."
Ejemplo n.º 3
0
def getconfig():
    config = initialization.initconffile('conf/pygopherd.conf')
    config.set("pygopherd", "root", os.path.abspath('./testdata'))
    return config
Ejemplo n.º 4
0
 def setUp(self):
     self.config = initialization.initconffile('conf/pygopherd.conf')
Ejemplo n.º 5
0
def getconfig():
    config = initialization.initconffile('conf/pygopherd.conf')
    config.set("pygopherd", "root", os.path.abspath('./testdata'))
    return config
Ejemplo n.º 6
0
 def setUp(self):
     self.config = initialization.initconffile('conf/pygopherd.conf')