test_hookenv.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:charm-helpers 作者: juju 项目源码 文件源码
def test_gets_execution_environment_no_relation(
            self, os_, relations_get, relations, relation_id,
            local_unit, relation_type, config):
        config.return_value = 'some-config'
        relation_type.return_value = 'some-type'
        local_unit.return_value = 'some-unit'
        relation_id.return_value = None
        relations.return_value = 'all-relations'
        relations_get.return_value = 'some-relations'
        os_.environ = 'some-environment'

        result = hookenv.execution_environment()

        self.assertEqual(result, {
            'conf': 'some-config',
            'unit': 'some-unit',
            'rels': 'all-relations',
            'env': 'some-environment',
        })
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号