def test_etcdreadtimeouterror_exception(self): utdocker.stop_container(*ETCD_NAMES) c = etcd.Client(host=HOSTS, read_timeout=1) self.assertRaises(etcd.EtcdReadTimeoutError, c.api_execute, '/v2/keys/abc', 'GET', timeout=1, raise_read_timeout=True)
def tearDown(self): utdocker.stop_container(zk_name) utdocker.remove_container(zk_name) dd('remove_container: ' + zk_name)
def test_next_server(self): utdocker.stop_container('etcd_t0') c = etcd.Client(host=HOSTS, read_timeout=2) c.set('key', 'val') self.assertIn('key', c)
def test_nomoremachine_exception(self): utdocker.stop_container(*ETCD_NAMES) c = etcd.Client(host=HOSTS, read_timeout=1) self.assertRaises(etcd.NoMoreMachineError, c.get, '/key')