mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 19:55:39 +00:00
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:
parent
ba1a5cc488
commit
f21cc713c4
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user