Example #1
0
 def test_config_is_loaded(self, tmpdir):
     path = str(tmpdir)
     config_path = os.path.join(path, '.chacractl')
     util.default_config_path = lambda: config_path
     util.ensure_default_config()
     module = util.load_config()
     assert module.user == 'chacra user'
     assert module.key == 'secret'
Example #2
0
 def api_credentials(self):
     util.ensure_default_config()
     user, key = os.environ.get("CHACRA_USER"), os.environ.get("CHACRA_KEY")
     if not user or not key:
         # check for the config file
         conf_module = util.load_config()
         user, key = conf_module.user, conf_module.key
     chacractl.config["credentials"] = (user, key)
     chacractl.config["url"] = conf_module.url
Example #3
0
 def api_credentials(self):
     util.ensure_default_config()
     user, key = os.environ.get('CHACRA_USER'), os.environ.get('CHACRA_KEY')
     if not user or not key:
         # check for the config file
         conf_module = util.load_config()
         user, key = conf_module.user, conf_module.key
     chacractl.config['credentials'] = (user, key)
     chacractl.config['url'] = conf_module.url
     chacractl.config['ssl_verify'] = getattr(conf_module, 'ssl_verify', True)
Example #4
0
 def api_credentials(self):
     util.ensure_default_config()
     user, key = os.environ.get('CHACRA_USER'), os.environ.get('CHACRA_KEY')
     if not user or not key:
         # check for the config file
         conf_module = util.load_config()
         user, key = conf_module.user, conf_module.key
     chacractl.config['credentials'] = (user, key)
     chacractl.config['url'] = conf_module.url
     chacractl.config['ssl_verify'] = getattr(conf_module, 'ssl_verify',
                                              True)
Example #5
0
 def test_no_config(self, tmpdir):
     path = str(tmpdir)
     config_path = os.path.join(path, '.chacractl')
     util.default_config_path = lambda: config_path
     module = util.load_config()
     assert module is None