Skip to content
Snippets Groups Projects
Commit 4d2bd00a authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

QA RAPI: Test HTTP 404 and 501


This tests the HTTP Not Found and Not Implemented errors.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent d0cb68cb
No related branches found
No related tags found
No related merge requests found
...@@ -178,6 +178,24 @@ def TestEmptyCluster(): ...@@ -178,6 +178,24 @@ def TestEmptyCluster():
("/2/os", None, 'GET', None), ("/2/os", None, 'GET', None),
]) ])
# Test HTTP Not Found
for method in ["GET", "PUT", "POST", "DELETE"]:
try:
_DoTests([("/99/resource/not/here/99", None, method, None)])
except rapi.client.GanetiApiError, err:
AssertEqual(err.code, 404)
else:
raise qa_error.Error("Non-existent resource didn't return HTTP 404")
# Test HTTP Not Implemented
for method in ["PUT", "POST", "DELETE"]:
try:
_DoTests([("/version", None, method, None)])
except rapi.client.GanetiApiError, err:
AssertEqual(err.code, 501)
else:
raise qa_error.Error("Non-implemented method didn't fail")
def TestInstance(instance): def TestInstance(instance):
"""Testing getting instance(s) info via remote API. """Testing getting instance(s) info via remote API.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment