当前位置: 首页>>代码示例>>Python>>正文


Python BuildDictionaryInfoExtracter.get_arg_descriptions_from_docstring方法代码示例

本文整理汇总了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))
开发者ID:cosmicexplorer,项目名称:pants,代码行数:13,代码来源:test_build_dictionary_info_extracter.py

示例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),
        )
开发者ID:ahamilton55,项目名称:pants,代码行数:15,代码来源:test_build_dictionary_info_extracter.py

示例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))
开发者ID:cosmicexplorer,项目名称:pants,代码行数:18,代码来源:test_build_dictionary_info_extracter.py

示例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))
开发者ID:cosmicexplorer,项目名称:pants,代码行数:20,代码来源:test_build_dictionary_info_extracter.py


注:本文中的pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter.get_arg_descriptions_from_docstring方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。