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