filecache: explicitly test 'repofilecache'
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 08 Mar 2017 16:43:16 -0800
changeset 31284 74cbbd5420ba
parent 31283 f84b0e926eb2
child 31285 1937671105bc
filecache: explicitly test 'repofilecache' The tests is actually about testing a repofilecache (it uses a fake repo). We make this clear to prevent blockers while cleaning theses API.
tests/test-filecache.py
--- a/tests/test-filecache.py	Fri Aug 05 14:25:21 2016 +0200
+++ b/tests/test-filecache.py	Wed Mar 08 16:43:16 2017 -0800
@@ -10,25 +10,30 @@
 from mercurial import (
     extensions,
     hg,
-    scmutil,
+    localrepo,
     ui as uimod,
     util,
     vfs as vfsmod,
 )
 
-filecache = scmutil.filecache
-
 class fakerepo(object):
     def __init__(self):
         self._filecache = {}
 
-    def join(self, p):
-        return p
+    class fakevfs(object):
+
+        def join(self, p):
+            return p
+
+    vfs = fakevfs()
+
+    def unfiltered(self):
+        return self
 
     def sjoin(self, p):
         return p
 
-    @filecache('x', 'y')
+    @localrepo.repofilecache('x', 'y')
     def cached(self):
         print('creating')
         return 'string from function'