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.

doc tests: Test endpoints in sorted order.

Steve Howellb196d5a2f056
diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.py
index c89c3d5f7cd..05856e2e4b0 100644
--- a/zerver/tests/test_docs.py
+++ b/zerver/tests/test_docs.py
@@ -173,13 +173,15 @@ class DocPageTest(ZulipTestCase):
api_page_raw = str(self.client_get("/api/").content)
ENDPOINT_REGEXP = re.compile(r"href=\"/api/\s*(.*?)\"")
endpoint_list_set = set(re.findall(ENDPOINT_REGEXP, api_page_raw))
- endpoint_list = [f"/api/{endpoint}" for endpoint in endpoint_list_set]
+ endpoint_list = sorted(endpoint_list_set)
+
# Validate that the parsing logic isn't broken, since if it
# broke, the below would become a noop.
self.assertGreater(len(endpoint_list), 70)
for endpoint in endpoint_list:
- self._test(endpoint, "", doc_html_str=True)
+ url = f"/api/{endpoint}"
+ self._test(url, "", doc_html_str=True)
def test_api_doc_404_status_codes(self) -> None:
result = self.client_get(