🚨(back) update code linting with ruff
Apply new rules provided with ruff version v0.9.3
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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():
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
@@ -55,9 +55,9 @@ def mock_reset_connections(settings):
|
||||
)
|
||||
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 (
|
||||
@@ -66,9 +66,9 @@ def mock_reset_connections(settings):
|
||||
), "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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user