1
# Copyright 2012 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
"""Fixture to simulate the cache that worker processes normally share."""
6
from __future__ import (
19
from fixtures import Fixture
20
from provisioningserver import cache
21
from testtools.monkey import MonkeyPatcher
24
class WorkerCacheFixture(Fixture):
25
"""Fake the cache that worker processes share."""
28
super(WorkerCacheFixture, self).setUp()
29
patcher = MonkeyPatcher(
30
(cache, 'cache', cache.Cache({})),
31
(cache, 'initialized', True))
32
self.addCleanup(patcher.restore)