Revision 4d2bd00a
b/qa/qa_rapi.py | ||
---|---|---|
178 | 178 |
("/2/os", None, 'GET', None), |
179 | 179 |
]) |
180 | 180 |
|
181 |
# Test HTTP Not Found |
|
182 |
for method in ["GET", "PUT", "POST", "DELETE"]: |
|
183 |
try: |
|
184 |
_DoTests([("/99/resource/not/here/99", None, method, None)]) |
|
185 |
except rapi.client.GanetiApiError, err: |
|
186 |
AssertEqual(err.code, 404) |
|
187 |
else: |
|
188 |
raise qa_error.Error("Non-existent resource didn't return HTTP 404") |
|
189 |
|
|
190 |
# Test HTTP Not Implemented |
|
191 |
for method in ["PUT", "POST", "DELETE"]: |
|
192 |
try: |
|
193 |
_DoTests([("/version", None, method, None)]) |
|
194 |
except rapi.client.GanetiApiError, err: |
|
195 |
AssertEqual(err.code, 501) |
|
196 |
else: |
|
197 |
raise qa_error.Error("Non-implemented method didn't fail") |
|
198 |
|
|
181 | 199 |
|
182 | 200 |
def TestInstance(instance): |
183 | 201 |
"""Testing getting instance(s) info via remote API. |
Also available in: Unified diff