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


Python hookenv.cache方法代码示例

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


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

示例1: tearDown

# 需要导入模块: from charmhelpers.core import hookenv [as 别名]
# 或者: from charmhelpers.core.hookenv import cache [as 别名]
def tearDown(self):
        # Reset cached cache
        hookenv.cache = {} 
开发者ID:openstack,项目名称:charm-plumgrid-gateway,代码行数:5,代码来源:test_pg_gw_utils.py

示例2: tearDown

# 需要导入模块: from charmhelpers.core import hookenv [as 别名]
# 或者: from charmhelpers.core.hookenv import cache [as 别名]
def tearDown(self):
        # Reset @cached cache
        hookenv.cache = {} 
开发者ID:openstack,项目名称:charm-ceph-osd,代码行数:5,代码来源:test_ceph_networking.py

示例3: _clean_globals

# 需要导入模块: from charmhelpers.core import hookenv [as 别名]
# 或者: from charmhelpers.core.hookenv import cache [as 别名]
def _clean_globals():
    hookenv.cache.clear()
    del hookenv._atstart[:]
    del hookenv._atexit[:] 
开发者ID:juju,项目名称:charm-helpers,代码行数:6,代码来源:test_hookenv.py

示例4: test_relation_set_flushes_local_unit_cache

# 需要导入模块: from charmhelpers.core import hookenv [as 别名]
# 或者: from charmhelpers.core.hookenv import cache [as 别名]
def test_relation_set_flushes_local_unit_cache(self, check_output,
                                                   check_call, local_unit):
        check_output.return_value = json.dumps('BAR').encode('UTF-8')
        local_unit.return_value = 'baz_unit'
        hookenv.relation_get(attribute='baz_scope', unit='baz_unit')
        hookenv.relation_get(attribute='bar_scope')
        self.assertTrue(len(hookenv.cache) == 2)
        check_output.return_value = ""
        hookenv.relation_set(baz_scope='hello')
        # relation_set should flush any entries for local_unit
        self.assertTrue(len(hookenv.cache) == 1) 
开发者ID:juju,项目名称:charm-helpers,代码行数:13,代码来源:test_hookenv.py


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