mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #33140 from rallytime/merge-2015.8
[2015.8] Merge forward from 2015.5 to 2015.8
This commit is contained in:
commit
72d075e14e
1 changed files with 23 additions and 0 deletions
23
doc/conf.py
23
doc/conf.py
|
@ -42,6 +42,9 @@ class Mock(object):
|
|||
# pylint: enable=R0903
|
||||
|
||||
MOCK_MODULES = [
|
||||
# Python stdlib
|
||||
'user',
|
||||
|
||||
# salt core
|
||||
'Crypto',
|
||||
'Crypto.Signature',
|
||||
|
@ -126,12 +129,32 @@ MOCK_MODULES = [
|
|||
for mod_name in MOCK_MODULES:
|
||||
sys.modules[mod_name] = Mock()
|
||||
|
||||
def mock_decorator_with_params(*oargs, **okwargs):
|
||||
'''
|
||||
Optionally mock a decorator that takes parameters
|
||||
|
||||
E.g.:
|
||||
|
||||
@blah(stuff=True)
|
||||
def things():
|
||||
pass
|
||||
'''
|
||||
def inner(fn, *iargs, **ikwargs):
|
||||
if hasattr(fn, '__call__'):
|
||||
return fn
|
||||
else:
|
||||
return Mock()
|
||||
return inner
|
||||
|
||||
# Define a fake version attribute for the following libs.
|
||||
sys.modules['libcloud'].__version__ = '0.0.0'
|
||||
sys.modules['pymongo'].version = '0.0.0'
|
||||
sys.modules['ntsecuritycon'].STANDARD_RIGHTS_REQUIRED = 0
|
||||
sys.modules['ntsecuritycon'].SYNCHRONIZE = 0
|
||||
|
||||
# Define a fake version attribute for the following libs.
|
||||
sys.modules['cherrypy'].config = mock_decorator_with_params
|
||||
|
||||
|
||||
# -- Add paths to PYTHONPATH ---------------------------------------------------
|
||||
try:
|
||||
|
|
Loading…
Add table
Reference in a new issue