def test_get_list_of_servers(self): cfg = ZooCfg(TYPICAL_ZOO_CFG) servers = cfg.get_servers() assert len(servers) == 3 assert servers[0].port == 2888 assert servers[0].election_port == 3888
def test_load_from_file(self): cfg = ZooCfg.from_file(abspath('samples/standalone-zoo.cfg')) assert cfg.dataDir == '/var/zookeeper/data/'
def test_leaderServers(self): self.check('LeaderServers', 0, 1, leaderServers='dummy') cfg = ZooCfg.from_file(abspath('samples/replicated-zoo.cfg')) self.check('LeaderServers', 1, 0, cfg)