MCPcopy Index your code
hub / github.com/python/cpython / test_annotations

Method test_annotations

Lib/test/test_docxmlrpc.py:196–207  ·  view source on GitHub ↗

Test that annotations works as expected

(self)

Source from the content-addressed store, hash-verified

194 response.read())
195
196 def test_annotations(self):
197 """ Test that annotations works as expected """
198 self.client.request("GET", "/")
199 response = self.client.getresponse()
200 docstring = (b'' if sys.flags.optimize >= 2 else
201 b'<dd><tt>Use&nbsp;function&nbsp;annotations.</tt></dd>')
202 self.assertIn(
203 (b'<dl><dt><a name="-annotation"><strong>annotation</strong></a>'
204 b'(x: int)</dt>' + docstring + b'</dl>\n'
205 b'<dl><dt><a name="-method_annotation"><strong>'
206 b'method_annotation</strong></a>(x: bytes)</dt></dl>'),
207 response.read())
208
209 def test_server_title_escape(self):
210 # bpo-38243: Ensure that the server title and documentation

Callers

nothing calls this directly

Calls 4

assertInMethod · 0.80
requestMethod · 0.45
getresponseMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected