示例#1
0
def get_testsuite_desc(suite):
    """
    Return the description of the testsuite.

    Remove trailing line returns if applicable, they look nasty
    in the reports (text and otherwise)
    """
    desc = suite.__doc__
    return format_description(desc.rstrip()) if desc else None
示例#2
0
def get_testcase_desc(suite, testcase_name):
    """
    Return the description of the testcase with the given name of the
    given testsuite.

    Remove trailing line returns if applicable, they look nasty
    in the reports (text and otherwise)
    """
    desc = getattr(suite, testcase_name).__doc__
    return format_description(desc.rstrip()) if desc else ''
示例#3
0
 def get_description(self, description, depth, row_idx):
     """
     Description for a test object,
     this will generally be docstring text.
     """
     return RowData(start=row_idx,
                    content=format_description(description),
                    style=RowStyle(font=(const.FONT_ITALIC,
                                         const.FONT_SIZE_SMALL),
                                   left_padding=const.INDENT * depth,
                                   text_color=colors.grey))
示例#4
0
 def get_description(self, description, depth, row_idx):
     """
     Description for a test object,
     this will generally be docstring text.
     """
     return RowData(
         start=row_idx,
         content=split_text(format_description(description),
                            const.FONT_ITALIC,
                            const.FONT_SIZE_SMALL,
                            const.PAGE_WIDTH - (depth * const.INDENT),
                            keep_leading_whitespace=True),
         style=RowStyle(font=(const.FONT_ITALIC, const.FONT_SIZE_SMALL),
                        left_padding=const.INDENT * depth,
                        text_color=colors.grey))
示例#5
0
def test_format_description(text, expected):
    format_description(text) == expected