def test_serverfactory_localhost(self): """ServerFactory must return ServerLocal instances for localhost""" _serverfactory = ServerFactory() _server = _serverfactory.makeServer("localhost") self.assert_(isinstance(_server, ServerLocal), "The ServerFactory does not create ServerLocal instances " "for localhost")
def test_serverfactory_localname(self): """ ServerFactory must return ServerLocal instances for the local hostname """ _localname = socket.gethostname() _serverfactory = ServerFactory() _server = _serverfactory.makeServer(_localname) self.assert_(isinstance(_server, ServerLocal), "The ServerFactory does not create ServerLocal instances " "for the local hostname")
def add_server(self, server, actions=None): """ Ajoute un serveur où doit être déployée cette application @param server: Le serveur où déployer, ou son nom. @type server: C{str} ou L{Server<lib.server.base.Server>} @param actions: Liste d'actions à effectuer sur ce server, par défaut C{stop} et C{start} @type actions: C{list} """ if actions is None: actions = ["stop", "start"] if isinstance(server, basestring): server_factory = ServerFactory() server = server_factory.makeServer(server) servername = server.name self.servers[servername] = server self.actions[servername] = actions