Skip to content

Commit

Permalink
reformat based on ruff changes (#1950)
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbahrai authored Sep 19, 2024
1 parent 1e7f50f commit c367017
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def generate_notifications_csv(**kwargs):
]
)
# Add encoded Byte Order Mark to the csv so MS Excel treats it as UTF-8 and properly renders accented FR characters.
yield "\uFEFF".encode("utf-8")
yield "\ufeff".encode("utf-8")
yield ",".join(fieldnames) + "\n"

while kwargs["page"]:
Expand Down
2 changes: 1 addition & 1 deletion application.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

application = Flask("app")
application.wsgi_app = ProxyFix(application.wsgi_app) # type: ignore
xray_recorder.configure(service='Notify-Admin')
xray_recorder.configure(service="Notify-Admin")
XRayMiddleware(application, xray_recorder)
create_app(application)

Expand Down
2 changes: 1 addition & 1 deletion tests/app/main/test_strip_whitespace_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ExampleFormSpecialField(Form):
"""
\t bar
""",
" \u180E\u200B \u200C bar \u200D \u2060\uFEFF ",
" \u180e\u200b \u200c bar \u200d \u2060\ufeff ",
],
)
@pytest.mark.parametrize(
Expand Down
2 changes: 1 addition & 1 deletion tests/app/main/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_for_commas_in_placeholders(client):
NoCommasInPlaceHolders()(None, _gen_mock_field("Hello ((name))"))


@pytest.mark.parametrize("msg", ["The quick brown fox", "Thé “quick” bröwn fox\u200B"])
@pytest.mark.parametrize("msg", ["The quick brown fox", "Thé “quick” bröwn fox\u200b"])
def test_sms_character_validation(client, msg):
OnlySMSCharacters()(None, _gen_mock_field(msg))

Expand Down
2 changes: 0 additions & 2 deletions tests/app/main/views/test_service_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4294,7 +4294,6 @@ def test_update_service_data_retention_populates_form(


class TestSettingSensitiveService:

def test_should_redirect_after_change_service_name(
self,
client_request,
Expand All @@ -4310,7 +4309,6 @@ def test_should_redirect_after_change_service_name(

class TestSuspendingCallbackApi:
def test_should_suspend_service_callback_api(self, client_request, platform_admin_user, mocker, service_one):

client_request.login(platform_admin_user, service_one)
client_request.post(
"main.suspend_callback",
Expand Down
4 changes: 2 additions & 2 deletions tests/app/main/views/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ def test_should_show_sms_template_with_downgraded_unicode_characters(
mock_get_template_folders,
fake_uuid,
):
msg = "here:\tare some “fancy quotes” and zero\u200Bwidth\u200Bspaces"
msg = "here:\tare some “fancy quotes” and zero\u200bwidth\u200bspaces"
rendered_msg = 'here: are some "fancy quotes" and zerowidthspaces'

mocker.patch(
Expand Down Expand Up @@ -2477,7 +2477,7 @@ def test_should_not_update_sms_template_with_emoji(
def test_should_create_sms_template_without_downgrading_unicode_characters(
client_request, mock_create_service_template, mock_get_template_categories, app_
):
msg = "here:\tare some “fancy quotes” and non\u200Bbreaking\u200Bspaces"
msg = "here:\tare some “fancy quotes” and non\u200bbreaking\u200bspaces"

client_request.post(
".add_service_template",
Expand Down

0 comments on commit c367017

Please sign in to comment.