mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
api: Document DELETE ../messages/{message_id}/reactions endpoint.
This refactors remove_reaction in python_examples.py to validate the
result with validate_against_openapi_schema. Minor changes and some
additions have been made to the OpenAPI format data for
/messages/{message_id}/reactions endpoint.
This commit is contained in:
@@ -715,15 +715,16 @@ def add_reaction(client, message_id):
|
||||
@openapi_test_function("/messages/{message_id}/reactions:delete")
|
||||
def remove_reaction(client, message_id):
|
||||
# type: (Client, int) -> None
|
||||
# {code_example|start}
|
||||
# Remove an emoji reaction
|
||||
request = {
|
||||
'message_id': str(message_id),
|
||||
'emoji_name': 'octopus',
|
||||
'reaction_type': 'unicode_emoji'
|
||||
}
|
||||
|
||||
result = client.remove_reaction(request)
|
||||
|
||||
assert result['result'] == 'success'
|
||||
# {code_example|end}
|
||||
validate_against_openapi_schema(result, '/messages/{message_id}/reactions', 'delete', '200')
|
||||
|
||||
def test_nonexistent_stream_error(client):
|
||||
# type: (Client) -> None
|
||||
|
||||
Reference in New Issue
Block a user