Test that the server correctly automatically wraps references to PEPS and RFCs with links, and that it linkifies text starting with http or ftp protocol prefixes. The documentation for the "add" method contains the test material.
(self)
| 134 | @make_request_and_skipIf(sys.flags.optimize >= 2, |
| 135 | "Docstrings are omitted with -O2 and above") |
| 136 | def test_autolinking(self): |
| 137 | """Test that the server correctly automatically wraps references to |
| 138 | PEPS and RFCs with links, and that it linkifies text starting with |
| 139 | http or ftp protocol prefixes. |
| 140 | |
| 141 | The documentation for the "add" method contains the test material. |
| 142 | """ |
| 143 | self.client.request("GET", "/") |
| 144 | response = self.client.getresponse().read() |
| 145 | |
| 146 | self.assertIn( |
| 147 | (b'<dl><dt><a name="-add"><strong>add</strong></a>(x, y)</dt><dd>' |
| 148 | b'<tt>Add two instances together. This ' |
| 149 | b'follows <a href="https://peps.python.org/pep-0008/">' |
| 150 | b'PEP008</a>, but has nothing<br>\nto do ' |
| 151 | b'with <a href="https://www.rfc-editor.org/rfc/rfc1952.txt">' |
| 152 | b'RFC1952</a>. Case should matter: pEp008 ' |
| 153 | b'and rFC1952. Things<br>\nthat start ' |
| 154 | b'with http and ftp should be ' |
| 155 | b'auto-linked, too:<br>\n<a href="http://google.com">' |
| 156 | b'http://google.com</a>.</tt></dd></dl>'), response) |
| 157 | |
| 158 | @make_request_and_skipIf(sys.flags.optimize >= 2, |
| 159 | "Docstrings are omitted with -O2 and above") |
nothing calls this directly
no test coverage detected