def get_dcs(name, config): if 'etcd' in config: assert config['etcd']['ttl'] > 2 * config['loop_wait'] return Etcd(name, config['etcd']) if 'zookeeper' in config: return ZooKeeper(name, config['zookeeper']) raise Exception('Can not find sutable configuration of distributed configuration store')
def set_up(self): requests.get = requests_get helpers.zookeeper.KazooClient = MockKazooClient self.zk = ZooKeeper( 'foo', { 'exhibitor': { 'hosts': ['localhost', 'exhibitor'], 'port': 8181 }, 'scope': 'test' })