diff tests/mock.py @ 448:c78eaebced8b

fs: Add support for builtin namespaces. Add stub page for a `help` namespace.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 07 Jan 2018 11:05:55 -0800
parents 64acfb58e023
children 2027ab79f006
line wrap: on
line diff
--- a/tests/mock.py	Wed Jan 03 01:04:53 2018 -0800
+++ b/tests/mock.py	Sun Jan 07 11:05:55 2018 -0800
@@ -91,6 +91,7 @@
 class MockFileSystem(FileSystem):
     def __init__(self, root, config, structure=None):
         super(MockFileSystem, self).__init__(root, config)
+        self.include_builtin_namespaces = False
         if not structure:
             self.structure = {}
         else:
@@ -99,6 +100,8 @@
     def getPageInfos(self, subdir=None):
         def tmp_walk(path):
             node = self._getNode(path)
+            if node is None:
+                raise Exception("No node at %s" % path)
             return mock_os_walk(path, node)
 
         orig_walk = os.walk
@@ -134,6 +137,8 @@
     def _getPhysicalPath(self, url, is_file=True, make_new=False):
         def tmp_walk(path):
             node = self._getNode(path)
+            if node is None:
+                raise Exception("No node at %s" % path)
             return mock_os_walk(path, node)
 
         orig_walk = os.walk