🚨(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:
|
for key in keys:
|
||||||
head_resp = s3_client.head_object(Bucket=bucket_name, Key=key)
|
head_resp = s3_client.head_object(Bucket=bucket_name, Key=key)
|
||||||
assert (
|
assert head_resp["ContentType"] == "image/png", (
|
||||||
head_resp["ContentType"] == "image/png"
|
f"ContentType not fixed, got {head_resp['ContentType']!r}"
|
||||||
), f"ContentType not fixed, got {head_resp['ContentType']!r}"
|
)
|
||||||
|
|
||||||
# Check that original metadata was preserved
|
# Check that original metadata was preserved
|
||||||
assert head_resp["Metadata"].get("owner") == "None"
|
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"]]
|
response_template_ids = [template["id"] for template in response_data["results"]]
|
||||||
|
|
||||||
template_ids.reverse()
|
template_ids.reverse()
|
||||||
assert (
|
assert response_template_ids == template_ids, (
|
||||||
response_template_ids == template_ids
|
"created_at values are not sorted from newest to oldest"
|
||||||
), "created_at values are not sorted from newest to oldest"
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_api_templates_list_order_param():
|
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"]]
|
response_template_ids = [template["id"] for template in response_data["results"]]
|
||||||
|
|
||||||
assert (
|
assert response_template_ids == templates_ids, (
|
||||||
response_template_ids == templates_ids
|
"created_at values are not sorted from oldest to newest"
|
||||||
), "created_at values are not sorted from oldest to newest"
|
)
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ def mock_reset_connections(settings):
|
|||||||
)
|
)
|
||||||
yield
|
yield
|
||||||
|
|
||||||
assert (
|
assert len(rsps.calls) == 1, (
|
||||||
len(rsps.calls) == 1
|
"Expected one call to reset-connections endpoint"
|
||||||
), "Expected one call to reset-connections endpoint"
|
)
|
||||||
request = rsps.calls[0].request
|
request = rsps.calls[0].request
|
||||||
assert request.url == endpoint_url, f"Unexpected URL called: {request.url}"
|
assert request.url == endpoint_url, f"Unexpected URL called: {request.url}"
|
||||||
assert (
|
assert (
|
||||||
@@ -66,9 +66,9 @@ def mock_reset_connections(settings):
|
|||||||
), "Incorrect Authorization header"
|
), "Incorrect Authorization header"
|
||||||
|
|
||||||
if user_id:
|
if user_id:
|
||||||
assert (
|
assert request.headers.get("X-User-Id") == user_id, (
|
||||||
request.headers.get("X-User-Id") == user_id
|
"Incorrect X-User-Id header"
|
||||||
), "Incorrect X-User-Id header"
|
)
|
||||||
|
|
||||||
return _mock_reset_connections
|
return _mock_reset_connections
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user