コード例 #1
0
 def test_get_hdx_key_site(self, hdx_key_file, project_config_yaml):
     actual_configuration = Configuration(hdx_site='prod', hdx_key_file=hdx_key_file,
                                          hdx_config_dict={},
                                          project_config_yaml=project_config_yaml)
     assert actual_configuration.get_api_key() == '12345'
     assert actual_configuration.get_hdx_site_url() == 'https://data.humdata.org/'
     assert actual_configuration._get_credentials() == ('', '')
コード例 #2
0
ファイル: hdxobject.py プロジェクト: jnarhan/hdx-python-api
 def __init__(self, configuration: Configuration, initial_data: dict):
     super(HDXObject, self).__init__(initial_data)
     self.configuration = configuration
     self.old_data = None
     version_file = open(script_dir_plus_file(join('..', 'version.txt'), HDXObject))
     version = version_file.read().strip()
     self.hdxpostsite = ckanapi.RemoteCKAN(configuration.get_hdx_site_url(),
                                           apikey=configuration.get_api_key(),
                                           user_agent='HDXPythonLibrary/%s' % version)
コード例 #3
0
 def test_get_hdx_key_site(self, hdx_key_file, project_config_yaml):
     actual_configuration = Configuration(hdx_site='uat', hdx_key_file=hdx_key_file,
                                          hdx_config_dict={},
                                          project_config_yaml=project_config_yaml)
     assert actual_configuration.get_api_key() == '12345'
     assert actual_configuration.get_hdx_site() == 'https://uat-data.humdata.org/'
コード例 #4
0
ファイル: hdxobject.py プロジェクト: miamitops/hdx-python-api
 def __init__(self, configuration: Configuration, initial_data: dict):
     super(HDXObject, self).__init__(initial_data)
     self.configuration = configuration
     self.old_data = None
     self.hdxpostsite = ckanapi.RemoteCKAN(configuration.get_hdx_site(),
                                           apikey=configuration.get_api_key())