コード例 #1
0
    def test_reindent_should_maintain_indentation(self):
        description = """\
    Parameters:

        - a
        - b
"""
        self.assertEqual(
            description, docformatter.reindent(description,
                                               indentation='    '))
コード例 #2
0
    def test_reindent_should_maintain_indentation(self):
        description = """\
    Parameters:

        - a
        - b
"""
        self.assertEqual(
            description,
            docformatter.reindent(description, indentation='    ')
        )
コード例 #3
0
    def test_reindent_with_no_indentation_expand_tabs(self):
        self.assertEqual(
            """\
The below should be indented with spaces:

        1. This too.
        2. And this.
""",
            docformatter.reindent("""\
The below should be indented with spaces:

\t1. This too.
\t2. And this.
            """,
                                  indentation=''))
コード例 #4
0
    def test_reindent_should_expand_tabs_to_indentation(self):
        self.assertEqual(
            """\
    This should be dedented.

    1. This too.
    2. And this.
""",
            docformatter.reindent("""\
                This should be dedented.

                1. This too.
        \t2. And this.
            """,
                                  indentation='    '))
コード例 #5
0
    def test_reindent(self):
        self.assertEqual(
            """\
    This should be dedented.

    1. This too.
    2. And this.
""",
            docformatter.reindent("""\
                This should be dedented.

                1. This too.
                2. And this.
            """,
                                  indentation='    '))
コード例 #6
0
    def test_reindent_should_expand_tabs_to_indentation(self):
        self.assertEqual(
            """\
    This should be dedented.

    1. This too.
    2. And this.
""",
            docformatter.reindent("""\
                This should be dedented.

                1. This too.
        \t2. And this.
            """, indentation='    ')
        )
コード例 #7
0
    def test_reindent(self):
        self.assertEqual(
            """\
    This should be dedented.

    1. This too.
    2. And this.
""",
            docformatter.reindent("""\
                This should be dedented.

                1. This too.
                2. And this.
            """, indentation='    ')
        )
コード例 #8
0
    def test_reindent_with_no_indentation_expand_tabs(self):
        self.assertEqual(
            """\
The below should be indented with spaces:

        1. This too.
        2. And this.
""",
            docformatter.reindent("""\
The below should be indented with spaces:

\t1. This too.
\t2. And this.
            """, indentation='')
        )