def test_get_value3(self): client = ApolloClient() client.init_with_conf() name = client.get_value(namespace='mongodb1.yaml', key="name2", default_val="默认值+") print name
def test_init1(self): client = ApolloClient() client.init_with_config( Config(app_id="demo", cluster="alpha", config_server_url="localhost:8080/")) print('\n'.join(['%s:%s' % item for item in client.__dict__.items()]))
def test_init2(self): client = ApolloClient() client.init_with_param( config_server_url="localhost:8080/", app_id="demo", cluster="alpha", timeout=62, env_local=False, ) print('\n'.join(['%s:%s' % item for item in client.__dict__.items()]))
def test_get_config_by_namespace1(self): client = ApolloClient() client.init_with_conf() all_value = client.get_config_by_namespace(namespace='redis.json') print all_value self.assertEquals( all_value, { u'info': { u'timeout': 60, u'size': 1024 }, u'path': u'/usr/alphatest', u'enabled': True })
def test_get_config_by_namespace4(self): client = ApolloClient() client.init_with_conf() all_value = client.get_config_by_namespace(namespace='mongodb2.yaml') print all_value
def test_get_config_by_namespace2(self): client = ApolloClient() client.init_with_conf() all_value = client.get_config_by_namespace() print all_value
def test_init3(self): client = ApolloClient() client.init_with_conf() print('\n'.join(['%s:%s' % item for item in client.__dict__.items()]))
def test_stop(self): client = ApolloClient() client.init_with_conf() print client.config_server_url client.start(namespace="mongodb.yaml", func=update_oncallback) client.stop()
def test_start4(self): client = ApolloClient() client.init_with_conf() client.start(namespace="mongodb1.yaml", func=update_oncallback)
def test_start3(self): client = ApolloClient() client.init_with_conf() client.start(namespace="redis1.json", func=update_oncallback)
def test_start2(self): client = ApolloClient() client.init_with_conf() client.start(func=update_oncallback)
def test_get_value1(self): client = ApolloClient() client.init_with_conf() name = client.get_value(namespace='mongodb.yaml', key="name") print name
def test_get_value0(self): client = ApolloClient() client.init_with_conf() path = client.get_value(namespace="redis.json", key='path') print path self.assertEquals(path, "/usr/alphatest")
def test_get_value(self): client = ApolloClient() client.init_with_conf() timeout = client.get_value(key='timeout') self.assertEquals(timeout, 85)