mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
api docs: Test sample fixture for nonexistent stream error.
In templates/zerver/api/stream-message.md, we have a sample fixture for when the target stream does not exist. This commit adds a test for that sample fixture.
This commit is contained in:
@@ -251,6 +251,19 @@ def stream_message(client):
|
||||
|
||||
return message_id
|
||||
|
||||
def test_nonexistent_stream_error(client):
|
||||
# type: (Client) -> None
|
||||
request = {
|
||||
"type": "stream",
|
||||
"to": "nonexistent_stream",
|
||||
"subject": "Castle",
|
||||
"content": "Something is rotten in the state of Denmark."
|
||||
}
|
||||
result = client.send_message(request)
|
||||
|
||||
fixture = FIXTURES['nonexistent-stream-error']
|
||||
test_against_fixture(result, fixture)
|
||||
|
||||
def private_message(client):
|
||||
# type: (Client) -> None
|
||||
|
||||
@@ -394,6 +407,8 @@ def test_messages(client):
|
||||
update_message(client, message_id)
|
||||
private_message(client)
|
||||
|
||||
test_nonexistent_stream_error(client)
|
||||
|
||||
def test_users(client):
|
||||
# type: (Client) -> None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user