本文整理汇总了Python中pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter.get_arg_descriptions_from_docstring方法的典型用法代码示例。如果您正苦于以下问题:Python BuildDictionaryInfoExtracter.get_arg_descriptions_from_docstring方法的具体用法?Python BuildDictionaryInfoExtracter.get_arg_descriptions_from_docstring怎么用?Python BuildDictionaryInfoExtracter.get_arg_descriptions_from_docstring使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter
的用法示例。
在下文中一共展示了BuildDictionaryInfoExtracter.get_arg_descriptions_from_docstring方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_arg_descriptions_from_docstring
# 需要导入模块: from pants.help.build_dictionary_info_extracter import BuildDictionaryInfoExtracter [as 别名]
# 或者: from pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter import get_arg_descriptions_from_docstring [as 别名]
def test_get_arg_descriptions_from_docstring(self):
def func(a, b, c):
"""Foo function.
:param a: Parameter a.
:param str b: Parameter b.
:param c: Parameter c.
"""
self.assertEqual({'a': 'Parameter a.', 'b': 'Parameter b.', 'c': 'Parameter c.'},
BuildDictionaryInfoExtracter.get_arg_descriptions_from_docstring(func))
示例2: test_get_arg_descriptions_from_docstring
# 需要导入模块: from pants.help.build_dictionary_info_extracter import BuildDictionaryInfoExtracter [as 别名]
# 或者: from pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter import get_arg_descriptions_from_docstring [as 别名]
def test_get_arg_descriptions_from_docstring(self):
def func(a, b, c):
"""Foo function.
:param a: Parameter a.
:param str b: Parameter b.
:param c: Parameter c.
"""
self.assertEqual(
{"a": "Parameter a.", "b": "Parameter b.", "c": "Parameter c."},
BuildDictionaryInfoExtracter.get_arg_descriptions_from_docstring(func),
)
示例3: test_get_arg_descriptions_with_nonparams_from_docstring
# 需要导入模块: from pants.help.build_dictionary_info_extracter import BuildDictionaryInfoExtracter [as 别名]
# 或者: from pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter import get_arg_descriptions_from_docstring [as 别名]
def test_get_arg_descriptions_with_nonparams_from_docstring(self):
# Test parameter help where help for items other than parameters is present.
def func(a, b, c):
"""Foo function.
:param a: Parameter a.
:type j: Type j.
:type k: Type k.
Second line Type k.
:param str b: Parameter b.
:param c: Parameter c.
:returns: Return.
"""
self.assertEqual({'a': 'Parameter a.', 'b': 'Parameter b.', 'c': 'Parameter c.'},
BuildDictionaryInfoExtracter.get_arg_descriptions_from_docstring(func))
示例4: test_get_multiline_arg_descriptions_from_docstring
# 需要导入模块: from pants.help.build_dictionary_info_extracter import BuildDictionaryInfoExtracter [as 别名]
# 或者: from pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter import get_arg_descriptions_from_docstring [as 别名]
def test_get_multiline_arg_descriptions_from_docstring(self):
# Test multiline parameter descriptions, including where all help is on subsequent line.
def func(a, b, c, d, e):
"""Foo function.
:param a: Parameter a.
:param str b: Parameter b.
:param c: Parameter c
Second line Parameter c.
:param d:
Parameter d.
:param e: Parameter e.
"""
self.assertEqual({'a': 'Parameter a.', 'b': 'Parameter b.',
'c': 'Parameter c Second line Parameter c.',
'd': 'Parameter d.', 'e': 'Parameter e.'},
BuildDictionaryInfoExtracter.get_arg_descriptions_from_docstring(func))