changeset 31293:74cbbd5420ba

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 08 Mar 2017 16:43:16 -0800
parents f84b0e926eb2
children 1937671105bc
files tests/test-filecache.py
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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'