Bug 1388365 - Return value from assert_success. r=whimboo

Return the contents of value, if it exists, after asserting the response
was successful.

assert_success can be passed a value which will assert that the response's
value matches an expected value.  If you want to compare a subsection
of the response it may be convenient to for the value to be returned
after it has been asserted that the response was a success.

MozReview-Commit-ID: 1dyzQIazYEN

--HG--
extra : rebase_source : f628f1fa144ccfd026b21df1b4bc2e748b08413c
This commit is contained in:
Andreas Tolfsen 2017-08-08 15:37:15 +01:00
parent ba1a5cc488
commit f21cc713c4

View File

@ -80,6 +80,7 @@ def assert_success(response, value=None):
assert response.status == 200
if value is not None:
assert response.body["value"] == value
return response.body.get("value")
def assert_dialog_handled(session, expected_text):
result = session.transport.send("GET",