MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_method_aliases

Method test_method_aliases

Lib/test/test_pydoc/test_pydoc.py:1081–1168  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1079 @unittest.expectedFailure # TODO: RUSTPYTHON
1080 @requires_docstrings
1081 def test_method_aliases(self):
1082 class A:
1083 def tkraise(self, aboveThis=None):
1084 """Raise this widget in the stacking order."""
1085 lift = tkraise
1086 def a_size(self):
1087 """Return size"""
1088 class B(A):
1089 def itemconfigure(self, tagOrId, cnf=None, **kw):
1090 """Configure resources of an item TAGORID."""
1091 itemconfig = itemconfigure
1092 b_size = A.a_size
1093
1094 doc = pydoc.render_doc(B)
1095 doc = clean_text(doc)
1096 self.assertEqual(doc, '''\
1097Python Library Documentation: class B in module %s
1098
1099class B(A)
1100 | Method resolution order:
1101 | B
1102 | A
1103 | builtins.object
1104 |
1105 | Methods defined here:
1106 |
1107 | b_size = a_size(self)
1108 |
1109 | itemconfig = itemconfigure(self, tagOrId, cnf=None, **kw)
1110 |
1111 | itemconfigure(self, tagOrId, cnf=None, **kw)
1112 | Configure resources of an item TAGORID.
1113 |
1114 | ----------------------------------------------------------------------
1115 | Methods inherited from A:
1116 |
1117 | a_size(self)
1118 | Return size
1119 |
1120 | lift = tkraise(self, aboveThis=None)
1121 |
1122 | tkraise(self, aboveThis=None)
1123 | Raise this widget in the stacking order.
1124 |
1125 | ----------------------------------------------------------------------
1126 | Data descriptors inherited from A:
1127 |
1128 | __dict__
1129 | dictionary for instance variables
1130 |
1131 | __weakref__
1132 | list of weak references to the object
1133''' % __name__)
1134
1135 doc = pydoc.render_doc(B, renderer=pydoc.HTMLDoc())
1136 expected_text = f"""
1137Python Library Documentation
1138

Callers

nothing calls this directly

Calls 6

clean_textFunction · 0.85
html2textFunction · 0.85
assertInMethod · 0.80
assertEqualMethod · 0.45
stripMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected