python类cache()的实例源码

test_pg_gw_utils.py 文件源码 项目:charm-plumgrid-gateway 作者: openstack 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def tearDown(self):
        # Reset cached cache
        hookenv.cache = {}
test_ceph_networking.py 文件源码 项目:charm-ceph-osd 作者: openstack 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def tearDown(self):
        # Reset @cached cache
        hookenv.cache = {}
test_neutron_api_utils.py 文件源码 项目:charm-neutron-api 作者: openstack 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def tearDown(self):
        # Reset cached cache
        hookenv.cache = {}
test_ceph_networking.py 文件源码 项目:charm-ceph-mon 作者: openstack 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def tearDown(self):
        # Reset @cached cache
        hookenv.cache = {}
test_neutron_ovs_utils.py 文件源码 项目:charm-neutron-openvswitch 作者: openstack 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def tearDown(self):
        # Reset cached cache
        hookenv.cache = {}
test_ceph_networking.py 文件源码 项目:charm-ceph 作者: openstack 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def tearDown(self):
        # Reset @cached cache
        hookenv.cache = {}
test_neutron_plumgrid_plugin_utils.py 文件源码 项目:charm-neutron-api-plumgrid 作者: openstack 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def tearDown(self):
        # Reset cached cache
        hookenv.cache = {}
test_pg_dir_utils.py 文件源码 项目:charm-plumgrid-director 作者: openstack 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def tearDown(self):
        # Reset cached cache
        hookenv.cache = {}
test_pg_dir_utils.py 文件源码 项目:charm-plumgrid-edge 作者: openstack 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def tearDown(self):
        # Reset cached cache
        hookenv.cache = {}
test_hookenv.py 文件源码 项目:charm-helpers 作者: juju 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def _clean_globals():
    hookenv.cache.clear()
    del hookenv._atstart[:]
    del hookenv._atexit[:]
test_hookenv.py 文件源码 项目:charm-helpers 作者: juju 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
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)


问题


面经


文章

微信
公众号

扫码关注公众号