Esempio n. 1
0
 def test_get_value3(self):
     client = ApolloClient()
     client.init_with_conf()
     name = client.get_value(namespace='mongodb1.yaml',
                             key="name2",
                             default_val="默认值+")
     print name
Esempio n. 2
0
 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()]))
Esempio n. 3
0
 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()]))
Esempio n. 4
0
 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
         })
Esempio n. 5
0
 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
Esempio n. 6
0
 def test_get_config_by_namespace2(self):
     client = ApolloClient()
     client.init_with_conf()
     all_value = client.get_config_by_namespace()
     print all_value
Esempio n. 7
0
 def test_init3(self):
     client = ApolloClient()
     client.init_with_conf()
     print('\n'.join(['%s:%s' % item for item in client.__dict__.items()]))
Esempio n. 8
0
 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()
Esempio n. 9
0
 def test_start4(self):
     client = ApolloClient()
     client.init_with_conf()
     client.start(namespace="mongodb1.yaml", func=update_oncallback)
Esempio n. 10
0
 def test_start3(self):
     client = ApolloClient()
     client.init_with_conf()
     client.start(namespace="redis1.json", func=update_oncallback)
Esempio n. 11
0
 def test_start2(self):
     client = ApolloClient()
     client.init_with_conf()
     client.start(func=update_oncallback)
Esempio n. 12
0
 def test_get_value1(self):
     client = ApolloClient()
     client.init_with_conf()
     name = client.get_value(namespace='mongodb.yaml', key="name")
     print name
Esempio n. 13
0
 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")
Esempio n. 14
0
 def test_get_value(self):
     client = ApolloClient()
     client.init_with_conf()
     timeout = client.get_value(key='timeout')
     self.assertEquals(timeout, 85)