mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 02:48:00 +00:00
api/delete-queue: Test fixture for BAD_EVENT_QUEUE_ID error.
In templates/zerver/api/delete-queue.md, we have a sample fixture for when the queue_id passed to client.deregister_queue is not valid or the event queue in question has already been deleted. This commit tests that fixture. Note that this error payload is specific to client.deregister_queue.
This commit is contained in:
@@ -445,9 +445,15 @@ def deregister_queue(client, queue_id):
|
||||
result = client.deregister(queue_id)
|
||||
# {code_example|end}
|
||||
|
||||
fixture = FIXTURES['delete-queue']
|
||||
fixture = FIXTURES['delete-queue']['successful_response']
|
||||
test_against_fixture(result, fixture)
|
||||
|
||||
# Test "BAD_EVENT_QUEUE_ID" error
|
||||
result = client.deregister(queue_id)
|
||||
fixture = FIXTURES['delete-queue']['bad_event_queue_id_error']
|
||||
test_against_fixture(result, fixture, check_if_equal=['code', 'result'],
|
||||
check_if_exists=['queue_id', 'msg'])
|
||||
|
||||
def test_invalid_api_key(client_with_invalid_key):
|
||||
# type: (Client) -> None
|
||||
result = client_with_invalid_key.list_subscriptions()
|
||||
|
||||
Reference in New Issue
Block a user