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.

test_openapi: Fix status code passed to validate_... in test_attributes.

Mateusz Manderaef468322f1c4
diff --git a/zerver/tests/test_openapi.py b/zerver/tests/test_openapi.py
index d063244529a..4b64c8105c5 100644
--- a/zerver/tests/test_openapi.py
+++ b/zerver/tests/test_openapi.py
@@ -934,13 +934,13 @@ class OpenAPIAttributesTest(ZulipTestCase):
for status_code, response in operation["responses"].items():
schema = response["content"]["application/json"]["schema"]
if "oneOf" in schema:
- for subschema_index, subschema in enumerate(schema["oneOf"]):
+ for _, subschema in enumerate(schema["oneOf"]):
validate_schema(subschema)
assert validate_against_openapi_schema(
subschema["example"],
path,
method,
- status_code + "_" + str(subschema_index),
+ status_code,
)
continue
validate_schema(schema)