🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

This commit is contained in:
pre-commit-ci[bot] 2025-07-16 16:40:50 +00:00
parent ed7afae7b8
commit 1e9741df66
2 changed files with 7 additions and 4 deletions

View File

@ -229,7 +229,7 @@ def get_redoc_html(
config_string = ""
if redoc_ui_parameters:
for key, value in redoc_ui_parameters.items():
config_string += f" {key}=\"{value}\""
config_string += f' {key}="{value}"'
html = f"""
<!DOCTYPE html>

View File

@ -69,13 +69,16 @@ def test_google_fonts_in_generated_redoc():
def test_generated_redoc_with_parameters():
body_with_parameters = get_redoc_html(
openapi_url="/docs", title="title", with_google_fonts=False, redoc_ui_parameters={"disable-search": "true"}
openapi_url="/docs",
title="title",
with_google_fonts=False,
redoc_ui_parameters={"disable-search": "true"},
).body.decode()
assert "disable-search=\"true\"" in body_with_parameters
assert 'disable-search="true"' in body_with_parameters
def test_generated_redoc_without_parameters():
body_without_parameters = get_redoc_html(
openapi_url="/docs", title="title", with_google_fonts=False
).body.decode()
assert "disable-search=\"true\"" not in body_without_parameters
assert 'disable-search="true"' not in body_without_parameters