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)
评论列表
文章目录