Bug 1410799 - Fix API docs for assert_error and assert_success r=jgraham
wdclient was the name of the old GitHub repository. The actual
Python package name is "webdriver".
MozReview-Commit-ID: FHy3iEB9aAj
--- a/testing/web-platform/tests/webdriver/tests/support/asserts.py
+++ b/testing/web-platform/tests/webdriver/tests/support/asserts.py
@@ -49,38 +49,39 @@ errors = {
# > name
# > message
# > message
# > stacktrace
# > stacktrace
# >
# > 5. Send a response with status and data as arguments.
def assert_error(response, error_code):
- """Verify that the provided wdclient.Response instance described a valid
- error response as defined by `dfn-send-an-error` and the provided error
- code.
+ """
+ Verify that the provided webdriver.Response instance described
+ a valid error response as defined by `dfn-send-an-error` and
+ the provided error code.
- :param response: wdclient.Response instance
- :param error_code: string value of the expected "error code"
+ :param response: ``webdriver.Response`` instance.
+ :param error_code: String value of the expected error code
"""
assert response.status == errors[error_code]
assert "value" in response.body
assert response.body["value"]["error"] == error_code
assert isinstance(response.body["value"]["message"], basestring)
assert isinstance(response.body["value"]["stacktrace"], basestring)
def assert_success(response, value=None):
- """Verify that the provided wdclient.Response instance described a valid
- error response as defined by `dfn-send-an-error` and the provided error
- code.
+ """
+ Verify that the provided webdriver.Response instance described
+ a valid error response as defined by `dfn-send-an-error` and
+ the provided error code.
- :param response: wdclient.Response instance.
+ :param response: ``webdriver.Response`` instance.
:param value: Expected value of the response body, if any.
-
"""
assert response.status == 200, str(response.error)
if value is not None:
assert response.body["value"] == value
return response.body.get("value")