api docs: Add page for common error payloads.

We now have a separate page for common error payloads, for example,
the payload for when the client's API key is invalid. All error
payloads that are presented on this page will be tested similarly
to our other non-error sample fixtures.
This commit is contained in:
Eeshan Garg
2018-02-06 16:34:07 -03:30
committed by Tim Abbott
parent 037c891fcf
commit 929724e5e7
21 changed files with 32 additions and 41 deletions

View File

@@ -14,7 +14,7 @@ os.chdir(ZULIP_PATH)
from zulip import Client
from tools.lib.test_server import test_server_running
from zerver.lib.api_test_helpers import test_the_api
from zerver.lib.api_test_helpers import test_the_api, test_invalid_api_key
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.test_settings'
django.setup()
@@ -35,4 +35,13 @@ with test_server_running(external_host='zulipdev.com:9981'):
print("Running API tests...")
test_the_api(client)
# Test error payloads
client = Client(
email=email,
api_key='abcedrsdfd',
site=site
)
test_invalid_api_key(client)
print("API tests passed!")