| 1 |  |  | import os.path | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  | import unittest | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | import sys | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | sys.path.insert(0, ".") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  | from coalib.bearlib.languages.documentation.DocstyleDefinition import ( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |     DocstyleDefinition) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | from coalib.bearlib.languages.documentation.DocumentationComment import ( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |     DocumentationComment) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  | from coalib.bearlib.languages.documentation.DocumentationExtraction import ( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |     extract_documentation) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | from coalib.misc.Compatability import FileNotFoundError | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | from coalib.results.TextRange import TextRange | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |  | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 16 |  |  | class DocumentationExtractionTest(unittest.TestCase): | 
            
                                                                        
                            
            
                                    
            
            
                | 17 |  |  |     def test_extract_documentation_invalid_input(self): | 
            
                                                                        
                            
            
                                    
            
            
                | 18 |  |  |         with self.assertRaises(FileNotFoundError): | 
            
                                                                        
                            
            
                                    
            
            
                | 19 |  |  |             tuple(extract_documentation("", "PYTHON", "INVALID")) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |     @staticmethod | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |     def load_testdata(filename): | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |         filename = (os.path.dirname(os.path.realpath(__file__)) + | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |                     "/documentation_extraction_testdata/" + filename) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |         with open(filename, "r") as fl: | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |             data = fl.read() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |         return data.splitlines(keepends=True) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |     def test_extract_documentation_C(self): | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |         data = DocumentationExtractionTest.load_testdata("data.c") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |         # No built-in documentation for C. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |         with self.assertRaises(KeyError): | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |             tuple(extract_documentation(data, "C", "default")) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |         docstyle_C_doxygen = DocstyleDefinition.load("C", "doxygen") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |         expected_results = (DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |                                 ("\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |                                  " This is the main function.\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |                                  "\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |                                  " @returns Your favorite number.\n"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |                                 docstyle_C_doxygen.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |                                 TextRange.from_values(3, 1, 7, 4)), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |                             DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |                                 ("\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |                                  " Preserves alignment\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |                                  " - Main item\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |                                  "   - sub item\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |                                  "     - sub sub item\n"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |                                 docstyle_C_doxygen.markers[2], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |                                 TextRange.from_values(15, 1, 20, 4)), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |                             DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |                                 (" ABC\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |                                  "    Another type of comment\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |                                  "\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |                                  "    ..."), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |                                 docstyle_C_doxygen.markers[1], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |                                 TextRange.from_values(23, 1, 26, 11)), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |                             DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |                                 (" foobar = barfoo.\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |                                  " @param x whatever...\n"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |                                 docstyle_C_doxygen.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |                                 TextRange.from_values(28, 1, 30, 4))) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |         self.assertEqual(tuple(extract_documentation(data, "C", "doxygen")), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |                          expected_results) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  |     def test_extract_documentation_C_2(self): | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  |         data = ['/** my main description\n', ' * continues here */'] | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |         docstyle_C_doxygen = DocstyleDefinition.load("C", "doxygen") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |         self.assertEqual( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |             list(extract_documentation(data, "C", "doxygen")), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |             [DocumentationComment(" my main description\n continues here", | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  |                                   docstyle_C_doxygen.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  |                                   TextRange.from_values(1, 1, 2, 21))]) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |     def test_extract_documentation_CPP(self): | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  |         data = DocumentationExtractionTest.load_testdata("data.cpp") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  |         # No built-in documentation for C++. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  |         with self.assertRaises(KeyError): | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  |             tuple(extract_documentation(data, "CPP", "default")) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  |         docstyle_CPP_doxygen = DocstyleDefinition.load("CPP", "doxygen") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |         self.assertEqual(tuple(extract_documentation(data, "CPP", "doxygen")), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |                          (DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  |                               ("\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |                                " This is the main function.\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  |                                " @returns Exit code.\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |                                "          Or any other number.\n"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  |                               docstyle_CPP_doxygen.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  |                               TextRange.from_values(4, 1, 8, 4)), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |                           DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  |                               (" foobar\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |                                " @param xyz\n"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  |                               docstyle_CPP_doxygen.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  |                               TextRange.from_values(15, 1, 17, 4)), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |                           DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |                               " Some alternate style of documentation\n", | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  |                               docstyle_CPP_doxygen.markers[4], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  |                               TextRange.from_values(22, 1, 23, 1)), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 |  |  |                           DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  |                               " ends instantly", | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 |  |  |                               docstyle_CPP_doxygen.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 |  |  |                               TextRange.from_values(26, 5, 26, 26)), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  |                           DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 |  |  |                               (" Should work\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  |                                "\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 |  |  |                                " even without a function standing below.\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  |                                "\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  |                                " @param foo WHAT PARAM PLEASE!?\n"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 117 |  |  |                               docstyle_CPP_doxygen.markers[4], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 118 |  |  |                               TextRange.from_values(32, 1, 37, 1)))) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 119 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 120 |  |  |     def test_extract_documentation_CPP_2(self): | 
            
                                                                                                            
                            
            
                                    
            
            
                | 121 |  |  |         data = DocumentationExtractionTest.load_testdata("data2.cpp") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 122 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 123 |  |  |         docstyle_CPP_doxygen = DocstyleDefinition.load("CPP", "doxygen") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 124 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 125 |  |  |         self.assertEqual(tuple(extract_documentation(data, "CPP", "doxygen")), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 126 |  |  |                          (DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 127 |  |  |                               ("module comment\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 128 |  |  |                                " hello world\n"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 129 |  |  |                               docstyle_CPP_doxygen.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 130 |  |  |                               TextRange.from_values(1, 1, 3, 4)),)) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 131 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 132 |  |  |     def test_extract_documentation_PYTHON3(self): | 
            
                                                                                                            
                            
            
                                    
            
            
                | 133 |  |  |         data = DocumentationExtractionTest.load_testdata("data.py") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 134 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 135 |  |  |         docstyle_PYTHON3_default = DocstyleDefinition.load("PYTHON3", | 
            
                                                                                                            
                            
            
                                    
            
            
                | 136 |  |  |                                                            "default") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 137 |  |  |         docstyle_PYTHON3_doxygen = DocstyleDefinition.load("PYTHON3", | 
            
                                                                                                            
                            
            
                                    
            
            
                | 138 |  |  |                                                            "doxygen") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 139 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 140 |  |  |         expected = (DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 |  |  |                         ("\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 |  |  |                          "Module description.\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  |                          "\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 |  |  |                          "Some more foobar-like text.\n"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 |  |  |                         docstyle_PYTHON3_default.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 |  |  |                         TextRange.from_values(1, 1, 5, 4)), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 |  |  |                     DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 |  |  |                         ("\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 |  |  |                          "A nice and neat way of documenting code.\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  |                          ":param radius: The explosion radius.\n"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  |                         docstyle_PYTHON3_default.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 |  |  |                         TextRange.from_values(8, 5, 11, 8)), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 |  |  |                     DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 |  |  |                         ("\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 |  |  |                          "Docstring with layouted text.\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 156 |  |  |                          "\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 157 |  |  |                          "    layouts inside docs are preserved for these " | 
            
                                                                                                            
                            
            
                                    
            
            
                | 158 |  |  |                          "documentation styles.\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 159 |  |  |                          "this is intended.\n"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 160 |  |  |                         docstyle_PYTHON3_default.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 161 |  |  |                         TextRange.from_values(14, 1, 19, 4)), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 162 |  |  |                     DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 163 |  |  |                         (" Docstring directly besides triple quotes.\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 164 |  |  |                          "    Continues here. "), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 165 |  |  |                         docstyle_PYTHON3_default.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 166 |  |  |                         TextRange.from_values(21, 1, 22, 24)), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 167 |  |  |                     DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 168 |  |  |                         ("super\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 169 |  |  |                          " nicely\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 170 |  |  |                          "short"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 171 |  |  |                         docstyle_PYTHON3_default.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 172 |  |  |                         TextRange.from_values(35, 1, 37, 9))) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 173 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 174 |  |  |         self.assertEqual( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 175 |  |  |             tuple(extract_documentation(data, "PYTHON3", "default")), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 176 |  |  |             expected) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 177 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 178 |  |  |         # Change only the docstyle in expected results. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 179 |  |  |         expected = list(DocumentationComment(r.documentation, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 180 |  |  |                                              r.marker, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 181 |  |  |                                              r.range) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 182 |  |  |                         for r in expected) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 183 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 184 |  |  |         expected.insert(4, DocumentationComment( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 185 |  |  |             (" Alternate documentation style in doxygen.\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 186 |  |  |              "  Subtext\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 187 |  |  |              " More subtext (not correctly aligned)\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 188 |  |  |              "      sub-sub-text\n" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 189 |  |  |              "\n"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 190 |  |  |             docstyle_PYTHON3_doxygen.markers[1], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 191 |  |  |             TextRange.from_values(25, 1, 30, 1))) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 192 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 193 |  |  |         self.assertEqual( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 194 |  |  |             list(extract_documentation(data, "PYTHON3", "doxygen")), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 195 |  |  |             expected) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 196 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 197 |  |  |     def test_extract_documentation_PYTHON3_2(self): | 
            
                                                                                                            
                            
            
                                    
            
            
                | 198 |  |  |         data = ['\n', '""" documentation in single line  """\n', 'print(1)\n'] | 
            
                                                                                                            
                            
            
                                    
            
            
                | 199 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 200 |  |  |         docstyle_PYTHON3_default = DocstyleDefinition.load("PYTHON3", | 
            
                                                                                                            
                            
            
                                    
            
            
                | 201 |  |  |                                                            "default") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 202 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 203 |  |  |         self.assertEqual( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 204 |  |  |             list(extract_documentation(data, "PYTHON3", "default")), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 205 |  |  |             [DocumentationComment(" documentation in single line  ", | 
            
                                                                                                            
                            
            
                                    
            
            
                | 206 |  |  |                                   docstyle_PYTHON3_default.markers[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 207 |  |  |                                   TextRange.from_values(2, 1, 2, 38))]) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 208 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 209 |  |  |     def test_extract_documentation_PYTHON3_3(self): | 
            
                                                                                                            
                            
            
                                    
            
            
                | 210 |  |  |         data = ['## documentation in single line without return at end.'] | 
            
                                                                                                            
                            
            
                                    
            
            
                | 211 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 212 |  |  |         docstyle_PYTHON3_doxygen = DocstyleDefinition.load("PYTHON3", | 
            
                                                                                                            
                            
            
                                    
            
            
                | 213 |  |  |                                                            "doxygen") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 214 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 215 |  |  |         self.assertEqual( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 216 |  |  |             list(extract_documentation(data, "PYTHON3", "doxygen")), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 217 |  |  |             [DocumentationComment(" documentation in single line without " | 
            
                                                                                                            
                            
            
                                    
            
            
                | 218 |  |  |                                       "return at end.", | 
            
                                                                                                            
                            
            
                                    
            
            
                | 219 |  |  |                                   docstyle_PYTHON3_doxygen.markers[1], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 220 |  |  |                                   TextRange.from_values(1, 1, 1, 55))]) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 221 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 222 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 223 |  |  | if __name__ == '__main__': | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 224 |  |  |     unittest.main(verbosity=2) | 
            
                                                        
            
                                    
            
            
                | 225 |  |  |  |