Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

curl_examples: Fix curl testing for multiple configs.

Suyash Vardhan Mathuracbae4b6cfcb
diff --git a/zerver/openapi/test_curl_examples.py b/zerver/openapi/test_curl_examples.py
index 3edbd6e0801..0c3506067a4 100644
--- a/zerver/openapi/test_curl_examples.py
+++ b/zerver/openapi/test_curl_examples.py
@@ -80,6 +80,8 @@ def test_generated_curl_examples_for_success(client: Client) -> None:
# example, and then run that to test it.
curl_command_html = md_engine.convert(line.strip())
unescaped_html = html.unescape(curl_command_html)
+ curl_regex = re.compile(r"<code>curl\n(.*?)</code>", re.DOTALL)
+ commands = re.findall(curl_regex, unescaped_html)
curl_command_text = unescaped_html[len("<p><code>curl\n") : -len("</code></p>")]
curl_command_text = curl_command_text.replace(
"BOT_EMAIL_ADDRESS:BOT_API_KEY", AUTHENTICATION_LINE[0]