def setUp(self): pettingzoo.utils.configure_logger() self.mock = True self.conn_string = '127.0.0.1:2181' if self.mock: import zc.zk.testing zc.zk.testing.setUp(self, connection_string=self.conn_string) self.connection = connect_to_zk(self.conn_string) self.path = '/test_discovery' pettingzoo.discovery.CONFIG_PATH = self.path self.sample = { 'header': { 'service_class': 'mysql', 'metadata': { 'version': 1.0 } }, 'username': '******', 'host': 'localhost', 'port': 3306, 'password': '******', 'database': 'reports', 'encoding': 'utf8' } self.sample_slash = { 'header': { 'service_class': 'cassandra/thrift', 'metadata': { 'version': 1.0 } }, 'host': 'localhost', 'port': 9160, }
def setUp(self): pettingzoo.utils.configure_logger() self.mock = True self.conn_string = '127.0.0.1:2181' if self.mock: import zc.zk.testing zc.zk.testing.setUp(self, connection_string=self.conn_string) self.connection = connect_to_zk(self.conn_string) self.path = '/test_discovery' pettingzoo.discovery.CONFIG_PATH = self.path self.sample = { 'header': { 'service_class': 'mysql', 'metadata': {'version': 1.0} }, 'username': '******', 'host': 'localhost', 'port': 3306, 'password': '******', 'database': 'reports', 'encoding': 'utf8' } self.sample_slash = { 'header': { 'service_class': 'cassandra/thrift', 'metadata': {'version': 1.0} }, 'host': 'localhost', 'port': 9160, }
def setUp(self): self.conn_string = '127.0.0.1:2181' if DO_MOCK: zc.zk.testing.setUp(self, connection_string=self.conn_string) zc.zk.testing.ZooKeeper.create = pettingzoo.testing.create zc.zk.testing.ZooKeeper.exists = pettingzoo.testing.exists zc.zk.testing.Node.deleted = pettingzoo.testing.deleted self.connection = connect_to_zk(self.conn_string) self.path = '/test_exists'
def tearDown(self): pettingzoo.discovery.CONFIG_PATH = '/discovery' self.connection.close() self.connection = connect_to_zk('127.0.0.1:2181') self.connection.delete_recursive(self.path) self.connection.close() if self.mock: import zc.zk.testing zc.zk.testing.tearDown(self)
def tearDown(self): self.connection.close() self.connection = connect_to_zk('127.0.0.1:2181') try: self.connection.delete_recursive(self.path) except zookeeper.NoNodeException: pass # does not exist finally: self.connection.close() if self.mock: import zc.zk.testing zc.zk.testing.tearDown(self)
def tearDown(self): self.connection.close() self.connection = connect_to_zk('127.0.0.1:2181') try: self.connection.delete_recursive(self.path) except zookeeper.NoNodeException: pass # does not exist finally: self.connection.close() if DO_MOCK: import zc.zk.testing zc.zk.testing.tearDown(self)
def setUp(self): self.mock = True self.conn_string = '127.0.0.1:2181' if self.mock: import zc.zk.testing import pettingzoo.testing zc.zk.testing.setUp(self, connection_string=self.conn_string) zc.zk.testing.ZooKeeper.create = pettingzoo.testing.create zc.zk.testing.ZooKeeper.exists = pettingzoo.testing.exists zc.zk.testing.Node.deleted = pettingzoo.testing.deleted self.connection = connect_to_zk(self.conn_string) self.path = '/test_dbag' self.touched = False configure_logger()
def setUp(self): self.mock = True self.conn_string = "127.0.0.1:2181" if self.mock: import zc.zk.testing import pettingzoo.testing zc.zk.testing.setUp(self, connection_string=self.conn_string) zc.zk.testing.ZooKeeper.create = pettingzoo.testing.create zc.zk.testing.ZooKeeper.exists = pettingzoo.testing.exists zc.zk.testing.Node.deleted = pettingzoo.testing.deleted self.connection = connect_to_zk(self.conn_string) self.path = "/test_dbag" self.touched = False configure_logger()
def setUp(self): pettingzoo.utils.configure_logger() self.mock = True self.conn_string = '127.0.0.1:2181' if self.mock: import zc.zk.testing zc.zk.testing.setUp(self, connection_string=self.conn_string) self.connection = connect_to_zk(self.conn_string) self.path = '/test_discovery' pettingzoo.discovery.CONFIG_PATH = self.path self.sample = { 'header': { 'service_class': 'mysql', 'metadata': { 'version': 1.0 } }, 'username': '******', 'host': 'localhost', 'port': 3306, 'password': '******', 'database': 'reports', 'encoding': 'utf8' } self.sample2 = { 'header': { 'service_class': 'mysql', 'metadata': { 'version': 1.0 } }, 'username': '******', 'host': 'notlocalhost', 'port': 3306, 'password': '******', 'database': 'reports', 'encoding': 'utf8' } pettingzoo.local_config.LocalConfig = pettingzoo.local_config.LocalConfigTest( ) pettingzoo.local_config.LocalConfig().add_config( self.sample, 'discovery/mysql/exist') self.list_sample = {'server_list': [self.sample]} pettingzoo.local_config.LocalConfig().add_config( self.list_sample, 'discovery/mysql/list') self.list_sample2 = {'server_list': [self.sample, self.sample2]} pettingzoo.local_config.LocalConfig().add_config( self.list_sample2, 'discovery/mysql/mlist')
def setUp(self): pettingzoo.utils.configure_logger() self.mock = True self.conn_string = '127.0.0.1:2181' if self.mock: import zc.zk.testing zc.zk.testing.setUp(self, connection_string=self.conn_string) self.connection = connect_to_zk(self.conn_string) self.path = '/test_discovery' pettingzoo.discovery.CONFIG_PATH = self.path self.sample = { 'header': { 'service_class': 'mysql', 'metadata': {'version': 1.0} }, 'username': '******', 'host': 'localhost', 'port': 3306, 'password': '******', 'database': 'reports', 'encoding': 'utf8' } self.sample2 = { 'header': { 'service_class': 'mysql', 'metadata': {'version': 1.0} }, 'username': '******', 'host': 'notlocalhost', 'port': 3306, 'password': '******', 'database': 'reports', 'encoding': 'utf8' } pettingzoo.local_config.LocalConfig = pettingzoo.local_config.LocalConfigTest() pettingzoo.local_config.LocalConfig().add_config( self.sample, 'discovery/mysql/exist') self.list_sample = {'server_list': [self.sample]} pettingzoo.local_config.LocalConfig().add_config( self.list_sample, 'discovery/mysql/list') self.list_sample2 = {'server_list': [self.sample, self.sample2]} pettingzoo.local_config.LocalConfig().add_config( self.list_sample2, 'discovery/mysql/mlist')