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:
Eeshan Garg
2018-02-16 19:19:35 -03:30
committed by Tim Abbott
parent a0818975fb
commit 9add5bf6a7
3 changed files with 20 additions and 13 deletions

View File

@@ -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()