style: format test files
This commit is contained in:
@@ -164,9 +164,7 @@ def running_container(container_runtime, built_image):
|
||||
yield BASE_URL
|
||||
|
||||
# Cleanup: stop and remove container
|
||||
subprocess.run(
|
||||
[container_runtime, "rm", "-f", CONTAINER_NAME], capture_output=True, timeout=30
|
||||
)
|
||||
subprocess.run([container_runtime, "rm", "-f", CONTAINER_NAME], capture_output=True, timeout=30)
|
||||
|
||||
|
||||
class TestContainerBuild:
|
||||
@@ -239,9 +237,7 @@ class TestContainerRuntime:
|
||||
paste_id = create_response.json()["id"]
|
||||
|
||||
# Retrieve
|
||||
get_response = requests.get(
|
||||
f"{running_container}/raw/{paste_id}", timeout=REQUEST_TIMEOUT
|
||||
)
|
||||
get_response = requests.get(f"{running_container}/raw/{paste_id}", timeout=REQUEST_TIMEOUT)
|
||||
assert get_response.status_code == 200
|
||||
assert get_response.content == content
|
||||
|
||||
@@ -257,9 +253,7 @@ class TestContainerRuntime:
|
||||
paste_id = create_response.json()["id"]
|
||||
|
||||
# Get info
|
||||
info_response = requests.get(
|
||||
f"{running_container}/{paste_id}", timeout=REQUEST_TIMEOUT
|
||||
)
|
||||
info_response = requests.get(f"{running_container}/{paste_id}", timeout=REQUEST_TIMEOUT)
|
||||
assert info_response.status_code == 200
|
||||
info = info_response.json()
|
||||
assert info["id"] == paste_id
|
||||
@@ -291,9 +285,7 @@ class TestContainerRuntime:
|
||||
|
||||
def test_not_found_returns_json(self, running_container):
|
||||
"""404 errors should return JSON."""
|
||||
response = requests.get(
|
||||
f"{running_container}/raw/nonexistent1234", timeout=REQUEST_TIMEOUT
|
||||
)
|
||||
response = requests.get(f"{running_container}/raw/nonexistent1234", timeout=REQUEST_TIMEOUT)
|
||||
assert response.status_code == 404
|
||||
assert "application/json" in response.headers.get("Content-Type", "")
|
||||
data = response.json()
|
||||
|
||||
Reference in New Issue
Block a user