mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
60d80fc06c
- Moves function to new location in salt.utils.doc.py - Adds deprecation warning to salt.utils.parse_docstring - Moves related unit test in test_utils.py to new test_doc.py file
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
'''
|
|
Unit Tests for functions located in salt.utils.doc.py.
|
|
'''
|
|
|
|
# Import python libs
|
|
from __future__ import absolute_import
|
|
|
|
# Import Salt libs
|
|
import salt.utils.doc
|
|
|
|
# Import Salt Testing libs
|
|
from tests.support.unit import TestCase
|
|
|
|
|
|
class DocUtilsTestCase(TestCase):
|
|
'''
|
|
Test case for doc util.
|
|
'''
|
|
|
|
def test_parse_docstring(self):
|
|
test_keystone_str = '''Management of Keystone users
|
|
============================
|
|
|
|
:depends: - keystoneclient Python module
|
|
:configuration: See :py:mod:`salt.modules.keystone` for setup instructions.
|
|
'''
|
|
|
|
ret = salt.utils.doc.parse_docstring(test_keystone_str)
|
|
expected_dict = {'deps': ['keystoneclient'],
|
|
'full': 'Management of Keystone users\n '
|
|
'============================\n\n '
|
|
':depends: - keystoneclient Python module\n '
|
|
':configuration: See :py:mod:`salt.modules.keystone` for setup instructions.\n'}
|
|
self.assertDictEqual(ret, expected_dict)
|