Skip to content

Commit

Permalink
🚨(back) update code linting with ruff
Browse files Browse the repository at this point in the history
Apply new rules provided with ruff version v0.9.3
  • Loading branch information
lunika committed Jan 28, 2025
1 parent 36eeca5 commit f15078b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def test_update_files_content_type_metadata():

for key in keys:
head_resp = s3_client.head_object(Bucket=bucket_name, Key=key)
assert (
head_resp["ContentType"] == "image/png"
), f"ContentType not fixed, got {head_resp['ContentType']!r}"
assert head_resp["ContentType"] == "image/png", (
f"ContentType not fixed, got {head_resp['ContentType']!r}"
)

# Check that original metadata was preserved
assert head_resp["Metadata"].get("owner") == "None"
12 changes: 6 additions & 6 deletions src/backend/core/tests/templates/test_api_templates_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ def test_api_templates_list_order_default():
response_template_ids = [template["id"] for template in response_data["results"]]

template_ids.reverse()
assert (
response_template_ids == template_ids
), "created_at values are not sorted from newest to oldest"
assert response_template_ids == template_ids, (
"created_at values are not sorted from newest to oldest"
)


def test_api_templates_list_order_param():
Expand All @@ -215,6 +215,6 @@ def test_api_templates_list_order_param():

response_template_ids = [template["id"] for template in response_data["results"]]

assert (
response_template_ids == templates_ids
), "created_at values are not sorted from oldest to newest"
assert response_template_ids == templates_ids, (
"created_at values are not sorted from oldest to newest"
)
12 changes: 6 additions & 6 deletions src/backend/core/tests/test_services_collaboration_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def _mock_reset_connections(document_id, user_id=None):
)
yield

assert (
len(rsps.calls) == 1
), "Expected one call to reset-connections endpoint"
assert len(rsps.calls) == 1, (
"Expected one call to reset-connections endpoint"
)
request = rsps.calls[0].request
assert request.url == endpoint_url, f"Unexpected URL called: {request.url}"
assert (
Expand All @@ -66,9 +66,9 @@ def _mock_reset_connections(document_id, user_id=None):
), "Incorrect Authorization header"

if user_id:
assert (
request.headers.get("X-User-Id") == user_id
), "Incorrect X-User-Id header"
assert request.headers.get("X-User-Id") == user_id, (
"Incorrect X-User-Id header"
)

return _mock_reset_connections

Expand Down

0 comments on commit f15078b

Please sign in to comment.