MCPcopy Index your code
hub / github.com/plotly/dash / test_mcpc006_expose_callback_docstrings

Function test_mcpc006_expose_callback_docstrings

tests/unit/mcp/test_mcp_configure.py:181–197  ·  view source on GitHub ↗

expose_callback_docstrings=True exposes docstrings; False hides them.

()

Source from the content-addressed store, hash-verified

179
180
181def test_mcpc006_expose_callback_docstrings():
182 """expose_callback_docstrings=True exposes docstrings; False hides them."""
183 app = _make_app()
184 configure_mcp_server(expose_callback_docstrings=True)
185 app_context.set(app)
186 app.mcp_callback_map = CallbackAdapterCollection(app)
187 with app.server.test_request_context():
188 tool = app.mcp_callback_map[0].as_mcp_tool
189 assert "A callback docstring." in tool.description
190
191 app2 = _make_app()
192 configure_mcp_server(expose_callback_docstrings=False)
193 app_context.set(app2)
194 app2.mcp_callback_map = CallbackAdapterCollection(app2)
195 with app2.server.test_request_context():
196 tool2 = app2.mcp_callback_map[0].as_mcp_tool
197 assert "A callback docstring." not in tool2.description
198
199
200def test_mcpc008_per_callback_false_overrides_server_level_docstrings():

Callers

nothing calls this directly

Calls 4

configure_mcp_serverFunction · 0.90
_make_appFunction · 0.70
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…