class EPUMZooKeeperStoreProxyKillsTests(BaseEPUMStoreTests, ZooKeeperTestMixin): # this runs all of the BaseEPUMStoreTests tests plus any # ZK-specific ones, but uses a proxy in front of ZK and restarts # the proxy before each call to the store. The effect is that for each store # operation, the first call to kazoo fails with a connection error, but the # client should handle that and retry def setUp(self): self.setup_zookeeper(base_path_prefix="/epum_store_tests_", use_proxy=True) self.real_store = ZooKeeperEPUMStore("epum", self.zk_hosts, self.zk_base_path, use_gevent=self.use_gevent) self.real_store.initialize() # have the tests use a wrapped store that restarts the connection before each call self.store = SocatProxyRestartWrapper(self.proxy, self.real_store) def tearDown(self): self.teardown_zookeeper() def test_the_fixture(self): # make sure test fixture actually works like we think def fake_operation(): self.store.kazoo.get("/") self.real_store.fake_operation = fake_operation self.assertRaises(KazooException, self.store.fake_operation)
class EPUMZooKeeperStoreTests(BaseEPUMStoreTests, ZooKeeperTestMixin): # this runs all of the BaseProvisionerStoreTests tests plus any # ZK-specific ones def setUp(self): self.setup_zookeeper("/epum_store_tests_") self.store = ZooKeeperEPUMStore("epum", self.zk_hosts, self.zk_base_path, use_gevent=self.use_gevent) self.store.initialize() def tearDown(self): self.teardown_zookeeper()
def setUp(self): self.setup_zookeeper(base_path_prefix="/epum_store_tests_", use_proxy=True) self.real_store = ZooKeeperEPUMStore("epum", self.zk_hosts, self.zk_base_path, use_gevent=self.use_gevent) self.real_store.initialize() # have the tests use a wrapped store that restarts the connection before each call self.store = SocatProxyRestartWrapper(self.proxy, self.real_store)
def setUp(self): self.setup_zookeeper("/epum_store_tests_") self.store = ZooKeeperEPUMStore("epum", self.zk_hosts, self.zk_base_path, use_gevent=self.use_gevent) self.store.initialize()