style: format test files
This commit is contained in:
@@ -150,9 +150,7 @@ class TestPastesList:
|
||||
assert data["count"] == 2
|
||||
assert data["offset"] == 2
|
||||
|
||||
def test_list_returns_metadata_only(
|
||||
self, app: Flask, auth_client: FlaskClient
|
||||
) -> None:
|
||||
def test_list_returns_metadata_only(self, app: Flask, auth_client: FlaskClient) -> None:
|
||||
"""List should return metadata, not content."""
|
||||
with app.app_context():
|
||||
create_paste(auth_client, b"secret content", owner="a" * 40)
|
||||
@@ -232,9 +230,7 @@ class TestPastesSearch:
|
||||
for paste in data["pastes"]:
|
||||
assert paste["created_at"] <= future
|
||||
|
||||
def test_search_combined_filters(
|
||||
self, app: Flask, auth_client: FlaskClient
|
||||
) -> None:
|
||||
def test_search_combined_filters(self, app: Flask, auth_client: FlaskClient) -> None:
|
||||
"""Multiple filters can be combined."""
|
||||
with app.app_context():
|
||||
create_paste(auth_client, b"test", owner="a" * 40)
|
||||
@@ -262,9 +258,7 @@ class TestPasteUpdate:
|
||||
response = client.put(f"/{paste_id}", data=b"new content")
|
||||
assert response.status_code == 401
|
||||
|
||||
def test_update_requires_ownership(
|
||||
self, app: Flask, auth_client: FlaskClient
|
||||
) -> None:
|
||||
def test_update_requires_ownership(self, app: Flask, auth_client: FlaskClient) -> None:
|
||||
"""Update requires paste ownership."""
|
||||
with app.app_context():
|
||||
# Create paste owned by different user
|
||||
@@ -312,9 +306,7 @@ class TestPasteUpdate:
|
||||
def test_update_password_remove(self, app: Flask, auth_client: FlaskClient) -> None:
|
||||
"""Owner can remove password from paste."""
|
||||
with app.app_context():
|
||||
paste_id = create_paste(
|
||||
auth_client, b"content", owner="a" * 40, password="secret"
|
||||
)
|
||||
paste_id = create_paste(auth_client, b"content", owner="a" * 40, password="secret")
|
||||
|
||||
response = auth_client.put(
|
||||
f"/{paste_id}",
|
||||
@@ -331,9 +323,7 @@ class TestPasteUpdate:
|
||||
def test_update_extend_expiry(self, app: Flask, auth_client: FlaskClient) -> None:
|
||||
"""Owner can extend paste expiry."""
|
||||
with app.app_context():
|
||||
paste_id = create_paste(
|
||||
auth_client, b"content", owner="a" * 40, expires_in=3600
|
||||
)
|
||||
paste_id = create_paste(auth_client, b"content", owner="a" * 40, expires_in=3600)
|
||||
# Get original expiry
|
||||
info_response = auth_client.get(f"/{paste_id}")
|
||||
original_expiry = info_response.get_json().get("expires_at")
|
||||
@@ -362,14 +352,10 @@ class TestPasteUpdate:
|
||||
response = auth_client.put("/000000000000", data=b"content")
|
||||
assert response.status_code == 404
|
||||
|
||||
def test_update_burn_after_read_forbidden(
|
||||
self, app: Flask, auth_client: FlaskClient
|
||||
) -> None:
|
||||
def test_update_burn_after_read_forbidden(self, app: Flask, auth_client: FlaskClient) -> None:
|
||||
"""Cannot update burn-after-read pastes."""
|
||||
with app.app_context():
|
||||
paste_id = create_paste(
|
||||
auth_client, b"content", owner="a" * 40, burn_after_read=True
|
||||
)
|
||||
paste_id = create_paste(auth_client, b"content", owner="a" * 40, burn_after_read=True)
|
||||
|
||||
response = auth_client.put(f"/{paste_id}", data=b"new content")
|
||||
assert response.status_code == 400
|
||||
@@ -405,9 +391,7 @@ class TestPasteDelete:
|
||||
get_response = auth_client.get(f"/{paste_id}")
|
||||
assert get_response.status_code == 404
|
||||
|
||||
def test_delete_requires_ownership(
|
||||
self, app: Flask, auth_client: FlaskClient
|
||||
) -> None:
|
||||
def test_delete_requires_ownership(self, app: Flask, auth_client: FlaskClient) -> None:
|
||||
"""Cannot delete paste owned by others."""
|
||||
with app.app_context():
|
||||
paste_id = create_paste(auth_client, b"content", owner="c" * 40)
|
||||
|
||||
Reference in New Issue
Block a user