From: Zooko O'Whielacronx Date: Tue, 7 Jul 2009 03:41:19 +0000 (-0700) Subject: directories: in bench_dirnode.py, use a real CacheDirectoryManager instead of a fake... X-Git-Url: https://git.rkrishnan.org/listings/pb3user.py?a=commitdiff_plain;h=4206a2c1c739814ba092808f7b7d1cd8cd38dafd;p=tahoe-lafs%2Ftahoe-lafs.git directories: in bench_dirnode.py, use a real CacheDirectoryManager instead of a fake one (because CacheDirectoryManager is a significant user of CPU and/or time) --- diff --git a/src/allmydata/test/bench_dirnode.py b/src/allmydata/test/bench_dirnode.py index 1d5d5d66..68011c6f 100644 --- a/src/allmydata/test/bench_dirnode.py +++ b/src/allmydata/test/bench_dirnode.py @@ -5,16 +5,14 @@ from pyutil import benchutil, randutil # http://allmydata.org/trac/pyutil from allmydata import client, dirnode, uri from allmydata.mutable import filenode as mut_filenode from allmydata.immutable import filenode as immut_filenode - -class FakeDownloadCache: - def get_file(self, key): - return None +from allmydata.util import cachedir, fileutil class FakeClient(client.Client): # just enough def __init__(self): self._node_cache = {} - self.download_cache = FakeDownloadCache() + download_cachedir = fileutil.NamedTemporaryDirectory() + self.download_cache_dirman = cachedir.CacheDirectoryManager(download_cachedir.name) def getServiceNamed(self, name): return None def get_encoding_parameters(self):