Example #1
0
 def _endpointServerTest(self, key, factoryClass):
     """
     Configure a service with two endpoints for the protocol associated with
     C{key} and verify that when the service is started a factory of type
     C{factoryClass} is used to listen on each of them.
     """
     cleartext = SpyEndpoint()
     secure = SpyEndpoint()
     config = Options()
     config[key] = [cleartext, secure]
     service = makeService(config)
     service.privilegedStartService()
     service.startService()
     self.addCleanup(service.stopService)
     self.assertIsInstance(cleartext.listeningWith, factoryClass)
     self.assertIsInstance(secure.listeningWith, factoryClass)
Example #2
0
 def _endpointServerTest(self, key, factoryClass):
     """
     Configure a service with two endpoints for the protocol associated with
     C{key} and verify that when the service is started a factory of type
     C{factoryClass} is used to listen on each of them.
     """
     cleartext = SpyEndpoint()
     secure = SpyEndpoint()
     config = Options()
     config[key] = [cleartext, secure]
     service = makeService(config)
     service.privilegedStartService()
     service.startService()
     self.addCleanup(service.stopService)
     self.assertIsInstance(cleartext.listeningWith, factoryClass)
     self.assertIsInstance(secure.listeningWith, factoryClass)