mirror of https://github.com/zulip/zulip.git
tests: Remove /messages/{message_id} from buggy endpoints.
This commit is contained in:
parent
bfc9089124
commit
cd06e0ab79
|
@ -601,7 +601,7 @@ paths:
|
||||||
type: integer
|
type: integer
|
||||||
example: 42
|
example: 42
|
||||||
required: true
|
required: true
|
||||||
- name: subject
|
- name: topic
|
||||||
in: query
|
in: query
|
||||||
description: The topic of the message. Only required for stream
|
description: The topic of the message. Only required for stream
|
||||||
messages. Maximum length of 60 characters.
|
messages. Maximum length of 60 characters.
|
||||||
|
|
|
@ -236,8 +236,6 @@ class OpenAPIArgumentsTest(ZulipTestCase):
|
||||||
# documentation and the actual API and need to be fixed:
|
# documentation and the actual API and need to be fixed:
|
||||||
buggy_documentation_endpoints = set([
|
buggy_documentation_endpoints = set([
|
||||||
'/events',
|
'/events',
|
||||||
# Docs need update for subject -> topic migration
|
|
||||||
'/messages/{message_id}',
|
|
||||||
])
|
])
|
||||||
|
|
||||||
def convert_regex_to_url_pattern(self, regex_pattern: str) -> str:
|
def convert_regex_to_url_pattern(self, regex_pattern: str) -> str:
|
||||||
|
@ -548,7 +546,7 @@ so maybe we shouldn't include it in pending_endpoints.
|
||||||
print(" +", openapi_parameter_names)
|
print(" +", openapi_parameter_names)
|
||||||
print(" -", accepted_arguments)
|
print(" -", accepted_arguments)
|
||||||
assert(url_pattern in self.buggy_documentation_endpoints)
|
assert(url_pattern in self.buggy_documentation_endpoints)
|
||||||
elif len(accepted_arguments - openapi_parameter_names) > 0:
|
elif len(accepted_arguments - openapi_parameter_names) > 0: # nocoverage
|
||||||
print("Documented invalid parameters for",
|
print("Documented invalid parameters for",
|
||||||
url_pattern, method, function_name)
|
url_pattern, method, function_name)
|
||||||
print(" -", openapi_parameter_names)
|
print(" -", openapi_parameter_names)
|
||||||
|
|
|
@ -1441,7 +1441,7 @@ def get_message_edit_history(request: HttpRequest, user_profile: UserProfile,
|
||||||
|
|
||||||
@has_request_variables
|
@has_request_variables
|
||||||
def update_message_backend(request: HttpRequest, user_profile: UserMessage,
|
def update_message_backend(request: HttpRequest, user_profile: UserMessage,
|
||||||
message_id: int=REQ(converter=to_non_negative_int),
|
message_id: int=REQ(converter=to_non_negative_int, path_only=True),
|
||||||
topic_name: Optional[str]=REQ_topic(),
|
topic_name: Optional[str]=REQ_topic(),
|
||||||
propagate_mode: Optional[str]=REQ(default="change_one"),
|
propagate_mode: Optional[str]=REQ(default="change_one"),
|
||||||
content: Optional[str]=REQ(default=None)) -> HttpResponse:
|
content: Optional[str]=REQ(default=None)) -> HttpResponse:
|
||||||
|
@ -1573,7 +1573,8 @@ def delete_message_backend(request: HttpRequest, user_profile: UserProfile,
|
||||||
|
|
||||||
@has_request_variables
|
@has_request_variables
|
||||||
def json_fetch_raw_message(request: HttpRequest, user_profile: UserProfile,
|
def json_fetch_raw_message(request: HttpRequest, user_profile: UserProfile,
|
||||||
message_id: int=REQ(converter=to_non_negative_int)) -> HttpResponse:
|
message_id: int=REQ(converter=to_non_negative_int,
|
||||||
|
path_only=True)) -> HttpResponse:
|
||||||
(message, user_message) = access_message(user_profile, message_id)
|
(message, user_message) = access_message(user_profile, message_id)
|
||||||
return json_success({"raw_content": message.content})
|
return json_success({"raw_content": message.content})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue