Code Duplication    Length = 22-29 lines in 2 locations

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

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