salt/tests/integration/modules/test_sysmod.py

29 lines
909 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import
2017-02-01 00:03:18 +00:00
# Import Salt Testing libs
from tests.support.case import ModuleCase
2012-03-28 18:07:48 +00:00
class SysModuleTest(ModuleCase):
2012-03-28 18:07:48 +00:00
'''
Validate the sys module
'''
2013-02-08 18:14:00 +00:00
def test_valid_docs(self):
'''
Make sure no functions are exposed that don't have valid docstrings
'''
ret = self.run_function('runtests_helpers.get_invalid_docs')
if ret == {'missing_docstring': [], 'missing_cli_example': []}:
return
raise AssertionError(
'There are some functions which do not have a docstring or do not '
'have an example:\nNo docstring:\n{0}\nNo example:\n{1}\n'.format(
'\n'.join([' - {0}'.format(f) for f in ret['missing_docstring']]),
'\n'.join([' - {0}'.format(f) for f in ret['missing_cli_example']]),
)
)