aboutsummaryrefslogtreecommitdiffhomepage
path: root/bindings
diff options
context:
space:
mode:
authorGravatar Justus Winter <4winter@informatik.uni-hamburg.de>2012-02-10 18:52:19 +0100
committerGravatar Justus Winter <4winter@informatik.uni-hamburg.de>2012-02-10 18:54:49 +0100
commit8c5be7d12dc5e48faf4008209327d34c04961616 (patch)
treea5301022bad2ca5942319d82a43a1da5e77fd70c /bindings
parentd2ef4edc545ea02764aa005bc3e56cdb4310ce09 (diff)
python: Add a Mock class to the sphinx config that can be used to mock modules
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/docs/source/conf.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/bindings/python/docs/source/conf.py b/bindings/python/docs/source/conf.py
index e0ee39cd..c7b95185 100644
--- a/bindings/python/docs/source/conf.py
+++ b/bindings/python/docs/source/conf.py
@@ -18,6 +18,23 @@ import sys, os
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0,os.path.abspath('../..'))
+class Mock(object):
+ def __init__(self, *args, **kwargs):
+ pass
+
+ def __call__(self, *args, **kwargs):
+ return Mock()
+
+ @classmethod
+ def __getattr__(self, name):
+ return Mock() if name not in ('__file__', '__path__') else '/dev/null'
+
+MOCK_MODULES = [
+]
+for mod_name in MOCK_MODULES:
+ sys.modules[mod_name] = Mock()
+
+
from notmuch import __VERSION__,__AUTHOR__
# -- General configuration -----------------------------------------------------