Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_parse_docstring():
"""Check ``parse_docstring`` parser result."""
docstring = """
:field1: value1
:field2: value2
:field3:
* item 1
* item 2
"""
assert parser.parse_docstring(docstring) == {
'field1': 'value1',
'field2': 'value2',
'field3': '<ul class="simple">\n<li><p>item 1</p></li>\n'
'<li><p>item 2</p></li>\n</ul>\n',
'field1\n'
'<p>value1</p>\n'
'\n'
'\n'
'field2\n'
'<p>value2</p>\n'
'\n'
'\n'
'field3\n'
'<p></p>\n'
'\n'
'\n'
'\n'
'\n'
)
assert parser.parse_rst(
docstring, parser.TableFieldListTranslator) == expected
def _get_default_description(testcase):
"""Return the default value for description field."""
return parser.parse_rst(testcase.docstring)