Esempio n. 1
0
 def setUpClass(cls):
     config.init_conf(package='spaceone.identity')
     config.set_service_config()
     config.set_global(MOCK_MODE=True)
     connect('test', host='mongomock://localhost')
     ProviderFactory(provider='aws',
                     name='AWS',
                     template={
                         'service_account': {
                             'schema': {
                                 'type': 'object',
                                 'properties': {
                                     'account_id': {
                                         'title': 'Account ID',
                                         'type': 'string'
                                     }
                                 },
                                 'required': ['account_id']
                             }
                         }
                     })
     cls.domain_id = utils.generate_id('domain')
     cls.transaction = Transaction({
         'service': 'identity',
         'api_class': 'ServiceAccount'
     })
     super().setUpClass()
    def setUpClass(cls):
        config.init_conf(package='spaceone.monitoring')
        config.set_service_config()
        config.set_global(MOCK_MODE=True)
        config_path = os.environ.get('TEST_CONFIG')
        test_config = utils.load_yaml_from_file(config_path)

        cls.transaction = Transaction()
        cls.connector_conf = test_config.get('MonitoringPluginConnector', {})
        cls.dsp_connector = DataSourcePluginConnector(cls.transaction, {})
        super().setUpClass()
Esempio n. 3
0
 def setUpClass(cls):
     config.init_conf(package='spaceone.identity')
     config.set_service_config()
     config.set_global(MOCK_MODE=True)
     connect('test', host='mongomock://localhost')
     cls.domain_id = utils.generate_id('domain')
     cls.transaction = Transaction({
         'service': 'identity',
         'api_class': 'Provider'
     })
     super().setUpClass()
Esempio n. 4
0
def config_server():
    # 1. Set a python path
    _set_python_path(package, module_path)

    # 2. Initialize config from command argument
    config.init_conf(package=package, server_type='grpc', port='50051')

    # 3. Get service config from global_conf.py
    config.set_service_config()

    # 4. Merge file conf
    with open(config_path, 'r') as f:
        _set_file_config(f)
    def setUpClass(cls):
        config.init_conf(package='spaceone.repository')
        config.set_service_config()
        config.set_global(MOCK_MODE=True)
        connect('test', host='mongomock://localhost')

        cls.repository_vo = RepositoryFactory(repository_type='local')
        cls.repository_id = cls.repository_vo.repository_id
        cls.domain_id = utils.generate_id('domain')
        cls.transaction = Transaction({
            'service': 'repository',
            'api_class': 'Schema'
        })
        super().setUpClass()
    def setUpClass(cls):
        config.init_conf(package='spaceone.monitoring')
        config.set_service_config()
        config.set_global(MOCK_MODE=True)
        config_path = os.environ.get('TEST_CONFIG')
        test_config = utils.load_yaml_from_file(config_path)

        cls.transaction = Transaction(
            {'token': test_config.get('access_token')})

        cls.domain_id = test_config.get('domain_id')
        cls.connector_conf = test_config.get('SecretConnector')
        cls.secret_connector = SecretConnector(cls.transaction,
                                               cls.connector_conf)
        super().setUpClass()
Esempio n. 7
0
def _set_server_config(command, package, module_path=None, port=None, config_file=None):
    # 1. Set a python path
    _set_python_path(package, module_path)

    # 2. Initialize config from command argument
    config.init_conf(
        package=package,
        server_type=command,
        port=port
    )

    # 3. Get service config from global_conf.py
    config.set_service_config()

    # 4. Merge file conf
    _set_file_config(config_file)