test_document.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:AskTanmay-NLQA-System- 作者: tanmayb123 项目源码 文件源码
def test_asReStructuredText_with_attribute_with_docstring(self):
        from zope.interface import Attribute
        from zope.interface import Interface
        EXPECTED = '\n\n'.join([
            "``IHasAttribute``",
            " This interface has an attribute.",
            " Attributes:",
            "  ``an_attribute`` -- This attribute is documented.",
            " Methods:",
            ""
        ])
        class IHasAttribute(Interface):
            """ This interface has an attribute.
            """
            an_attribute = Attribute('an_attribute',
                                     'This attribute is documented.')

        self.assertEqual(self._callFUT(IHasAttribute), EXPECTED)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号