test_doc.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # -*- coding: utf-8 -*-
  2. '''
  3. Unit Tests for functions located in salt.utils.doc.py.
  4. '''
  5. # Import python libs
  6. from __future__ import absolute_import, print_function, unicode_literals
  7. # Import Salt libs
  8. import salt.utils.doc
  9. # Import Salt Testing libs
  10. from tests.support.unit import TestCase
  11. class DocUtilsTestCase(TestCase):
  12. '''
  13. Test case for doc util.
  14. '''
  15. def test_parse_docstring(self):
  16. test_keystone_str = '''Management of Keystone users
  17. ============================
  18. :depends: - keystoneclient Python module
  19. :configuration: See :py:mod:`salt.modules.keystone` for setup instructions.
  20. '''
  21. ret = salt.utils.doc.parse_docstring(test_keystone_str)
  22. expected_dict = {'deps': ['keystoneclient'],
  23. 'full': 'Management of Keystone users\n '
  24. '============================\n\n '
  25. ':depends: - keystoneclient Python module\n '
  26. ':configuration: See :py:mod:`salt.modules.keystone` for setup instructions.\n'}
  27. self.assertDictEqual(ret, expected_dict)