Skip to content

Commit cd2fe05

Browse files
Hani YacoubHani Yacoub
authored andcommitted
Do the assertion in the test
1 parent ab14ed2 commit cd2fe05

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

modules/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def assert_json_value(self, json_data, jsonpath_expr, expected_value):
316316
"""Parse json and validate json search string with its value"""
317317
expr = parse(jsonpath_expr)
318318
match = expr.find(json_data)
319-
assert match[0].value == expected_value, f"Expected {expected_value}, but got {match[0].value}"
319+
return match[0].value == expected_value, f"Expected {expected_value}, but got {match[0].value}"
320320

321321

322322
class BrowserActions:

tests/address_bar_and_search/test_google_search_counts_us.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ def test_google_search_counts_us(driver: Firefox):
2525

2626
# Verify pings are recorded
2727
json_data = u.decode_url(driver)
28-
u.assert_json_value(json_data, '$..SEARCH_COUNTS.["google-b-1-d.urlbar"].sum', 1)
29-
u.assert_json_value(json_data, '$..["browser.search.content.urlbar"].["google:tagged:firefox-b-1-d"]', 1)
28+
assert u.assert_json_value(json_data, '$..SEARCH_COUNTS.["google-b-1-d.urlbar"].sum', 1)
29+
assert u.assert_json_value(json_data, '$..["browser.search.content.urlbar"].["google:tagged:firefox-b-1-d"]', 1)

0 commit comments

Comments
 (0)