Skip to content

Commit 66f78d0

Browse files
committed
lint
1 parent 0d98f74 commit 66f78d0

32 files changed

+134
-136
lines changed

l10n_CM/Unified/test_demo_ad_address_data_captured_in_doorhanger_and_stored.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,6 @@ def test_demo_ad_address_data_captured_in_doorhanger_and_stored(
8787
found_address_data = any(
8888
all(value in element.text for value in expected_values) for element in elements
8989
)
90-
assert found_address_data, "Street, city, state (if applicable), zip, or country were not found in any of the address entries!"
90+
assert found_address_data, (
91+
"Street, city, state (if applicable), zip, or country were not found in any of the address entries!"
92+
)

l10n_CM/Unified/test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
from typing import Dict
2-
31
import pytest
42
from selenium.webdriver import Firefox
53

64
from modules.browser_object_autofill_popup import AutofillPopup
75
from modules.page_object_autofill import AddressFill
86
from modules.page_object_prefs import AboutPrefs
9-
from modules.util import BrowserActions, Utilities
7+
from modules.util import Utilities
108

119

1210
@pytest.fixture()
@@ -62,9 +60,9 @@ def test_demo_ad_email_phone_captured_in_doorhanger_and_stored(
6260
)
6361
expected_values = [expected_phone, expected_email]
6462
found_email_phone = list(set(elements) & set(expected_values))
65-
assert (
66-
found_email_phone
67-
), "Email or phone were not found in any of the address entries!"
63+
assert found_email_phone, (
64+
"Email or phone were not found in any of the address entries!"
65+
)
6866

6967

7068
def data_sanitizer(value: str):

l10n_CM/Unified/test_demo_ad_name_org_captured_in_doorhanger_and_stored.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ def test_demo_ad_name_org_captured_in_doorhanger_and_stored(
5252
found_name_org = any(
5353
all(value in element.text for value in expected_values) for element in elements
5454
)
55-
assert (
56-
found_name_org
57-
), "Name or organization were not found in any of the address entries!"
55+
assert found_name_org, (
56+
"Name or organization were not found in any of the address entries!"
57+
)

l10n_CM/Unified/test_demo_cc_clear_form.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from modules.browser_object_autofill_popup import AutofillPopup
55
from modules.page_object import AboutPrefs, CreditCardFill
6-
from modules.util import BrowserActions, Utilities
6+
from modules.util import Utilities
77

88

99
@pytest.fixture()

modules/browser_object_tracker_panel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ def verify_tracker_shield_indicator(self, nav: Navigation) -> BasePage:
145145
assert (
146146
shield_icon.get_attribute("data-l10n-id")
147147
== "tracking-protection-icon-active-container"
148-
), "The label detected did not correspond to the expected one: tracking-protection-icon-active-container"
148+
), (
149+
"The label detected did not correspond to the expected one: tracking-protection-icon-active-container"
150+
)
149151
return self
150152

151153
def open_and_return_cross_site_trackers(self) -> List[WebElement]:

modules/page_base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,9 @@ def verify_opened_image_url(self, url_substr: str, pattern: str) -> Page:
437437
self.url_contains(url_substr)
438438
current_url = self.driver.current_url
439439

440-
assert re.match(
441-
pattern, current_url
442-
), f"URL does not match the expected pattern: {current_url}"
440+
assert re.match(pattern, current_url), (
441+
f"URL does not match the expected pattern: {current_url}"
442+
)
443443
return self
444444

445445
def fill(
@@ -490,9 +490,9 @@ def fetch(self, reference: Union[str, tuple, WebElement], labels=[]) -> WebEleme
490490
return self.find_element(*reference)
491491
elif isinstance(reference, WebElement):
492492
return reference
493-
assert (
494-
False
495-
), "Bad fetch: only selectors, selector names, or WebElements allowed."
493+
assert False, (
494+
"Bad fetch: only selectors, selector names, or WebElements allowed."
495+
)
496496

497497
def click_on(self, reference: Union[str, tuple, WebElement], labels=[]) -> Page:
498498
"""Click on an element, no matter the context, return the page"""

tests/address_bar_and_search/test_adaptive_history_autofill.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ def test_add_adaptive_history_autofill(driver: Firefox):
6161
)
6262

6363
# Assertion to verify that the 'autofill_adaptive' type is found
64-
assert (
65-
autofill_adaptive_element.get_attribute("type") == "autofill_adaptive"
66-
), f"Expected element type to be 'autofill_adaptive' but found '{autofill_adaptive_element.get_attribute('type')}'"
64+
assert autofill_adaptive_element.get_attribute("type") == "autofill_adaptive", (
65+
f"Expected element type to be 'autofill_adaptive' but found '{autofill_adaptive_element.get_attribute('type')}'"
66+
)
6767

6868
# Assertion to check the autofilled URL is the expected one
69-
assert (
70-
"nationalgeographic.com/science" in autofill_adaptive_element.text
71-
), "URL 'https://www.nationalgeographic.com/science' not found in autofill suggestions."
69+
assert "nationalgeographic.com/science" in autofill_adaptive_element.text, (
70+
"URL 'https://www.nationalgeographic.com/science' not found in autofill suggestions."
71+
)

tests/address_bar_and_search/test_default_search_provider_change_awesome_bar.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import pytest
22
from selenium.webdriver import Firefox
3-
from selenium.webdriver.common.by import By
43

54
from modules.browser_object import Navigation
65
from modules.page_object import AboutPrefs

tests/address_bar_and_search/test_preferences_all_toggles_enabled.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import logging
21
from time import sleep
32

43
import pytest
@@ -29,13 +28,13 @@ def test_preferences_all_toggles_enabled(driver: Firefox):
2928
if not show_suggestions_checkbox.is_selected():
3029
show_suggestions_checkbox.click()
3130
nonsponsored_checkbox = about_prefs.get_element("firefox-suggest-nonsponsored")
32-
assert (
33-
nonsponsored_checkbox.is_selected()
34-
), f"Checkbox with selector '{nonsponsored_checkbox}' is not checked"
31+
assert nonsponsored_checkbox.is_selected(), (
32+
f"Checkbox with selector '{nonsponsored_checkbox}' is not checked"
33+
)
3534
sponsors_checkbox = about_prefs.get_element("firefox-suggest-sponsored")
36-
assert (
37-
sponsors_checkbox.is_selected()
38-
), f"Checkbox with selector '{sponsors_checkbox}' is not checked"
35+
assert sponsors_checkbox.is_selected(), (
36+
f"Checkbox with selector '{sponsors_checkbox}' is not checked"
37+
)
3938

4039
# Check if sponsored suggestion is displayed. Keep checking until the sponsered suggestions are displayed
4140
found = False

tests/address_bar_and_search/test_tile_menu_options.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,6 @@ def test_tile_context_menu_options(driver: Firefox, index: int, sponsored: bool)
138138
set_in_use.remove(match)
139139
logging.info(f"Detected the context item: {match}")
140140

141-
assert (
142-
len(set_in_use) == 0
143-
), "Did not find all of the required context menu actions."
141+
assert len(set_in_use) == 0, (
142+
"Did not find all of the required context menu actions."
143+
)

0 commit comments

Comments
 (0)