tests/test-check-interfaces.py
changeset 37441 a3202fa83aff
parent 37320 39f7d4ee8bcd
child 37545 93397c4633f6
--- a/tests/test-check-interfaces.py	Thu Apr 05 15:09:41 2018 -0700
+++ b/tests/test-check-interfaces.py	Thu Apr 05 15:18:23 2018 -0700
@@ -12,6 +12,7 @@
 )
 from mercurial import (
     bundlerepo,
+    filelog,
     httppeer,
     localrepo,
     repository,
@@ -19,13 +20,14 @@
     statichttprepo,
     ui as uimod,
     unionrepo,
+    vfs as vfsmod,
     wireprotoserver,
     wireprototypes,
 )
 
 rootdir = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
 
-def checkzobject(o):
+def checkzobject(o, allowextra=False):
     """Verify an object with a zope interface."""
     ifaces = zi.providedBy(o)
     if not ifaces:
@@ -37,6 +39,9 @@
     for iface in ifaces:
         ziverify.verifyObject(iface, o)
 
+    if allowextra:
+        return
+
     # Now verify that the object provides no extra public attributes that
     # aren't declared as part of interfaces.
     allowed = set()
@@ -132,4 +137,10 @@
     httpv2 = wireprotoserver.httpv2protocolhandler(None, None)
     checkzobject(httpv2)
 
+    ziverify.verifyClass(repository.ifilestorage, filelog.filelog)
+
+    vfs = vfsmod.vfs('.')
+    fl = filelog.filelog(vfs, 'dummy.i')
+    checkzobject(fl, allowextra=True)
+
 main()