2013-11-27 11:19:24 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2013-06-27 11:52:36 +00:00
|
|
|
# Import python libs
|
2014-11-21 19:05:13 +00:00
|
|
|
from __future__ import absolute_import
|
2017-02-01 00:03:18 +00:00
|
|
|
|
2013-06-27 11:52:36 +00:00
|
|
|
# Import Salt Testing libs
|
2017-02-27 15:59:04 +00:00
|
|
|
import tests.integration as integration
|
2012-05-05 14:09:23 +00:00
|
|
|
|
2012-03-28 18:07:48 +00:00
|
|
|
|
|
|
|
class SysModuleTest(integration.ModuleCase):
|
|
|
|
'''
|
|
|
|
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
|
|
|
|
'''
|
2017-02-26 18:21:00 +00:00
|
|
|
ret = self.run_function('runtests_helpers.get_invalid_docs')
|
|
|
|
if ret == {'missing_docstring': [], 'missing_cli_example': []}:
|
2013-02-17 12:52:36 +00:00
|
|
|
return
|
|
|
|
|
|
|
|
raise AssertionError(
|
2014-07-15 15:26:55 +00:00
|
|
|
'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(
|
2017-02-26 18:21:00 +00:00
|
|
|
'\n'.join([' - {0}'.format(f) for f in ret['missing_docstring']]),
|
|
|
|
'\n'.join([' - {0}'.format(f) for f in ret['missing_cli_example']]),
|
2013-02-17 12:52:36 +00:00
|
|
|
)
|
|
|
|
)
|