Code Duplication    Length = 22-29 lines in 2 locations

tests/bearlib/languages/documentation/DocumentationCommentTest.py 2 locations

@@ 108-136 (lines=29) @@
105
                    self.ReturnValue(desc=' something2 ')]
106
        self.check_docstring(doc, expected)
107
108
    def test_python_default(self):
109
        data = load_testdata("default.py")
110
111
        parsed_docs = [doc.parse() for doc in
112
                       extract_documentation(data, "python", "default")]
113
114
        expected = [
115
            [self.Description(desc='\nModule description.\n\n'
116
                                   'Some more foobar-like text.\n')],
117
            [self.Description(desc='\nA nice and neat way of '
118
                                   'documenting code.\n'),
119
             self.Parameter(name='radius', desc=' The explosion radius. ')],
120
            [self.Description(desc='A function that returns 55.')],
121
            [self.Description(desc='\nDocstring with layouted text.\n\n    '
122
                                   'layouts inside docs are preserved.'
123
                                   '\nthis is intended.\n')],
124
            [self.Description(desc=' Docstring inline with triple quotes.\n'
125
                                   '    Continues here. ')],
126
            [self.Description(desc='\nThis is the best docstring ever!\n\n'),
127
             self.Parameter(name='param1',
128
                            desc='\n    Very Very Long Parameter '
129
                                 'description.\n'),
130
             self.Parameter(name='param2',
131
                            desc='\n    Short Param description.\n\n'),
132
             self.ReturnValue(desc=' Long Return Description That Makes No '
133
                                   'Sense And Will\n         Cut to the Next'
134
                                   ' Line.\n')]]
135
136
        self.assertEqual(parsed_docs, expected)
137
138
    def test_python_doxygen(self):
139
        data = load_testdata("doxygen.py")
@@ 138-159 (lines=22) @@
135
136
        self.assertEqual(parsed_docs, expected)
137
138
    def test_python_doxygen(self):
139
        data = load_testdata("doxygen.py")
140
141
        parsed_docs = [doc.parse() for doc in
142
                       extract_documentation(data, "python", "doxygen")]
143
144
        expected = [
145
            [self.Description(desc=' @package pyexample\n  Documentation for'
146
                                   ' this module.\n\n  More details.\n')],
147
            [self.Description(
148
                desc=' Documentation for a class.\n\n More details.\n')],
149
            [self.Description(desc=' The constructor.\n')],
150
            [self.Description(desc=' Documentation for a method.\n'),
151
             self.Parameter(name='self', desc='The object pointer.\n')],
152
            [self.Description(desc=' A class variable.\n')],
153
            [self.Description(desc=' @var _memVar\n  a member variable\n')],
154
            [self.Description(desc=' This is the best docstring ever!\n\n'),
155
             self.Parameter(name='param1', desc='Parameter 1\n'),
156
             self.Parameter(name='param2', desc='Parameter 2\n'),
157
             self.ReturnValue(desc='Nothing\n')]]
158
159
        self.assertEqual(parsed_docs, expected)
160
161
162
class JavaDocumentationCommentTest(DocumentationCommentTest):