def testMasterServerList(IP, port): message = 'GETSERVERINFO' response = network.sendAndGetResponseFromIP(IP, port, message) servers = server.netStringToServerList(response) assert len(servers) == 4 assert servers[0].role == "master" print "Master Server List Test Passed"
def saveServerInfo(self, netString): self.servers = server.netStringToServerList(netString) self.aliveSlaves = filter(lambda s : s.role=='slave' and s.alive, self.servers) self.m = len(self.aliveSlaves) log.info("Server informations saved")
def saveServerInfo(self, netString): self.servers = server.netStringToServerList(netString) self.aliveSlaves = filter(lambda s: s.role == 'slave' and s.alive, self.servers) self.m = len(self.aliveSlaves) log.info("Server informations saved")