当前位置: 首页>>代码示例>>Python>>正文


Python NuleculeComponent.load_config方法代码示例

本文整理汇总了Python中atomicapp.nulecule.base.NuleculeComponent.load_config方法的典型用法代码示例。如果您正苦于以下问题:Python NuleculeComponent.load_config方法的具体用法?Python NuleculeComponent.load_config怎么用?Python NuleculeComponent.load_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在atomicapp.nulecule.base.NuleculeComponent的用法示例。


在下文中一共展示了NuleculeComponent.load_config方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_load_config_external_app

# 需要导入模块: from atomicapp.nulecule.base import NuleculeComponent [as 别名]
# 或者: from atomicapp.nulecule.base.NuleculeComponent import load_config [as 别名]
    def test_load_config_external_app(self, mock_merge_config):
        """Test load config for external app"""
        mock_nulecule = mock.Mock(
            name='nulecule',
            spec=Nulecule('some-id', '0.0.2', {}, [], 'some/path')
        )
        params = [
            {'name': 'key1'},
            {'name': 'key2'}
        ]
        initial_config = {
            'general': {'a': 'b', 'key2': 'val2'},
            'some-app': {'key1': 'val1'}
        }

        nc = NuleculeComponent('some-app', 'some/path', params=params)
        nc._app = mock_nulecule
        nc.load_config(config=copy.deepcopy(initial_config))

        mock_nulecule.load_config.assert_called_once_with(
            config={
                'general': {'a': 'b', 'key2': 'val2'},
                'some-app': {'key1': 'val1', 'key2': 'val2'}
            }, ask=False, skip_asking=False)
        mock_merge_config.assert_called_once_with(
            nc.config, mock_nulecule.config)
开发者ID:surajssd,项目名称:atomicapp,代码行数:28,代码来源:test_nulecule_component.py

示例2: test_load_config_local_app

# 需要导入模块: from atomicapp.nulecule.base import NuleculeComponent [as 别名]
# 或者: from atomicapp.nulecule.base.NuleculeComponent import load_config [as 别名]
    def test_load_config_local_app(self):
        """Test load config for local app"""
        params = [
            {'name': 'key1', 'description': 'key1'},
            {'name': 'key2', 'description': 'key2'}
        ]
        initial_config = {
            'general': {'a': 'b', 'key2': 'val2'},
            'some-app': {'key1': 'val1'}
        }
        conf = Config(answers=initial_config)

        nc = NuleculeComponent('some-app', 'some/path',
                               params=params, config=conf)
        nc.load_config()
        runtime_answers = nc.config.runtime_answers()
        self.assertEqual(runtime_answers, {
            'general': {
                'a': 'b',
                'key2': 'val2',
                'provider': 'kubernetes',
                'namespace': 'default'
            },
            'some-app': {'key1': 'val1'}
        })
开发者ID:LalatenduMohanty,项目名称:atomicapp,代码行数:27,代码来源:test_nulecule_component.py

示例3: test_load_config_local_app

# 需要导入模块: from atomicapp.nulecule.base import NuleculeComponent [as 别名]
# 或者: from atomicapp.nulecule.base.NuleculeComponent import load_config [as 别名]
    def test_load_config_local_app(self):
        """Test load config for local app"""
        params = [
            {'name': 'key1'},
            {'name': 'key2'}
        ]
        initial_config = {
            'general': {'a': 'b', 'key2': 'val2'},
            'some-app': {'key1': 'val1'}
        }

        nc = NuleculeComponent('some-app', 'some/path', params=params)
        nc.load_config(config=copy.deepcopy(initial_config))

        self.assertEqual(nc.config, {
            'general': {'a': 'b', 'key2': 'val2'},
            'some-app': {'key1': 'val1', 'key2': 'val2'}
        })
开发者ID:surajssd,项目名称:atomicapp,代码行数:20,代码来源:test_nulecule_component.py

示例4: test_load_config_external_app

# 需要导入模块: from atomicapp.nulecule.base import NuleculeComponent [as 别名]
# 或者: from atomicapp.nulecule.base.NuleculeComponent import load_config [as 别名]
    def test_load_config_external_app(self):
        """Test load config for external app"""
        params = [
            {'name': 'key1', 'description': 'key1'},
            {'name': 'key2', 'description': 'key2'}
        ]
        initial_config = {
            'general': {'a': 'b', 'key2': 'val2'},
            'some-app': {'key1': 'val1'}
        }
        config = Config(answers=initial_config)
        mock_nulecule = mock.Mock(
            name='nulecule',
            spec=Nulecule('some-id', '0.0.2', config, [], 'some/path')
        )

        nc = NuleculeComponent('some-app', 'some/path', params=params)
        nc._app = mock_nulecule
        nc.config = config
        nc.load_config()

        mock_nulecule.load_config.assert_called_once_with(
            config=config, ask=False, skip_asking=False)
开发者ID:LalatenduMohanty,项目名称:atomicapp,代码行数:25,代码来源:test_nulecule_component.py


注:本文中的atomicapp.nulecule.base.NuleculeComponent.load_config方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。