def setUp(self):
del hookenv._atstart[:]
del hookenv._atexit[:]
hookenv.cache.clear()
coordinator.Singleton._instances.clear()
def install(patch):
patch.start()
self.addCleanup(patch.stop)
install(patch.object(hookenv, 'local_unit', return_value='foo/1'))
install(patch.object(hookenv, 'is_leader', return_value=False))
install(patch.object(hookenv, 'metadata',
return_value={'peers': {'cluster': None}}))
install(patch.object(hookenv, 'log'))
# Ensure _timestamp always increases.
install(patch.object(coordinator, '_utcnow',
side_effect=self._utcnow))
评论列表
文章目录