Ejemplo n.º 1
0
 def test_parseFile(self):
     """
     Services are parsed from given C{file}.
     """
     conf = inetdconf.ServicesConf()
     with open(self.servicesFilename2) as f:
         conf.parseFile(f)
     self.assertEqual(conf.services, {
         ("https", "tcp"): 443,
     })
Ejemplo n.º 2
0
 def test_parseDefaultFilename(self):
     """
     Services are parsed from default filename.
     """
     conf = inetdconf.ServicesConf()
     conf.defaultFilename = self.servicesFilename1
     conf.parseFile()
     self.assertEqual(
         conf.services, {
             ("http", "tcp"): 80,
             ("http", "udp"): 80,
             ("http", "sctp"): 80,
             ("www", "tcp"): 80,
             ("www", "udp"): 80,
             ("www-http", "tcp"): 80,
             ("www-http", "udp"): 80,
         })