api docs: Document the GET /messages/<message_id> endpoint.

This commit is contained in:
Yago González
2018-06-23 18:17:05 +02:00
committed by Tim Abbott
parent ab164ba740
commit 9575f1b51f
5 changed files with 125 additions and 27 deletions

View File

@@ -344,6 +344,19 @@ def get_messages(client):
validate_against_openapi_schema(result, '/messages', 'get', '200')
assert len(result['messages']) <= request['num_before']
def get_raw_message(client, message_id):
# type: (Client, int) -> None
assert int(message_id)
# {code_example|start}
# Get the raw content of the message with ID "message_id"
result = client.get_raw_message(message_id)
# {code_example|end}
validate_against_openapi_schema(result, '/messages/{message_id}', 'get',
'200')
def send_message(client):
# type: (Client) -> int
@@ -580,6 +593,7 @@ TEST_FUNCTIONS = {
'/messages/render:post': render_message,
'/messages:get': get_messages,
'/messages:post': send_message,
'/messages/{message_id}:get': get_raw_message,
'/messages/{message_id}:patch': update_message,
'/get_stream_id:get': get_stream_id,
'get-subscribed-streams': list_subscriptions,
@@ -652,6 +666,7 @@ def test_messages(client, nonadmin_client):
render_message(client)
message_id = send_message(client)
update_message(client, message_id)
get_raw_message(client, message_id)
get_messages(client)
test_nonexistent_stream_error(client)