MCPcopy
hub / github.com/fastapi/fastapi / test_strings_in_generated_swagger

Function test_strings_in_generated_swagger

tests/test_local_docs.py:6–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6def test_strings_in_generated_swagger():
7 sig = inspect.signature(get_swagger_ui_html)
8 swagger_js_url = sig.parameters.get("swagger_js_url").default # type: ignore
9 swagger_css_url = sig.parameters.get("swagger_css_url").default # type: ignore
10 swagger_favicon_url = sig.parameters.get("swagger_favicon_url").default # type: ignore
11 html = get_swagger_ui_html(openapi_url="/docs", title="title")
12 body_content = bytes(html.body).decode()
13 assert swagger_js_url in body_content
14 assert swagger_css_url in body_content
15 assert swagger_favicon_url in body_content
16
17
18def test_strings_in_custom_swagger():

Callers

nothing calls this directly

Calls 2

get_swagger_ui_htmlFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…