mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:12:08 +08:00
Format.
This commit is contained in:
@@ -591,8 +591,7 @@ class TestGalaxyInstallApis(ShedApiTestCase):
|
||||
api_asserts.assert_status_code_is_ok(response)
|
||||
assert len(response.content) > 0, "Expected non-empty image content"
|
||||
content_type = response.headers.get("content-type", "")
|
||||
assert "image/png" in content_type, \
|
||||
f"Expected image/png content-type, got {content_type}"
|
||||
assert "image/png" in content_type, f"Expected image/png content-type, got {content_type}"
|
||||
|
||||
def test_display_image_nonexistent_file(self):
|
||||
"""Requesting a nonexistent image should return empty/error."""
|
||||
@@ -621,8 +620,7 @@ class TestGalaxyInstallApis(ShedApiTestCase):
|
||||
# htseq_count.tar contains htseq-count.xml — a non-image file
|
||||
url = f"{self.url}/repository/static/images/{repository.id}/htseq-count.xml"
|
||||
response = requests.get(url)
|
||||
assert response.status_code >= 400, \
|
||||
f"Expected rejection of non-image file, got {response.status_code}"
|
||||
assert response.status_code >= 400, f"Expected rejection of non-image file, got {response.status_code}"
|
||||
|
||||
# ---- status_for_installed_repository (redirect) ----------------------
|
||||
|
||||
|
||||
@@ -13,14 +13,14 @@ from typing import Optional
|
||||
|
||||
from fastapi import Form
|
||||
from starlette.requests import Request
|
||||
from galaxy.exceptions import ObjectNotFound
|
||||
from galaxy.tool_shed.util.repository_util import get_absolute_path_to_file_in_repository
|
||||
from starlette.responses import (
|
||||
FileResponse,
|
||||
RedirectResponse,
|
||||
Response,
|
||||
)
|
||||
|
||||
from galaxy.exceptions import ObjectNotFound
|
||||
from galaxy.tool_shed.util.repository_util import get_absolute_path_to_file_in_repository
|
||||
from tool_shed.context import SessionRequestContext
|
||||
from tool_shed.managers.repositories import (
|
||||
get_changeset_revision_and_ctx_rev_str,
|
||||
@@ -33,8 +33,8 @@ from tool_shed.managers.repositories import (
|
||||
previous_changeset_revisions_str,
|
||||
updated_changeset_revisions_str,
|
||||
)
|
||||
from tool_shed.util.repository_util import get_repository_in_tool_shed
|
||||
from tool_shed.structured_app import ToolShedApp
|
||||
from tool_shed.util.repository_util import get_repository_in_tool_shed
|
||||
from . import (
|
||||
depends,
|
||||
DependsOnTrans,
|
||||
@@ -54,7 +54,6 @@ router = Router(tags=["legacy_install"])
|
||||
class FastAPILegacyInstall:
|
||||
app: ToolShedApp = depends(ToolShedApp)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/repository/get_ctx_rev",
|
||||
operation_id="legacy_install__get_ctx_rev",
|
||||
@@ -146,7 +145,6 @@ class FastAPILegacyInstall:
|
||||
result = get_tool_dependencies_for_changeset(self.app, name, owner, changeset_revision)
|
||||
return Response(content=result, media_type="text/plain")
|
||||
|
||||
|
||||
@router.get(
|
||||
"/repository/get_repository_dependencies",
|
||||
operation_id="legacy_install__get_repository_dependencies",
|
||||
@@ -182,7 +180,6 @@ class FastAPILegacyInstall:
|
||||
) -> dict:
|
||||
return get_required_repo_info_dict_from_encoded(trans, encoded_str)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/repository/status_for_installed_repository",
|
||||
operation_id="legacy_install__status_for_installed_repository",
|
||||
|
||||
@@ -121,5 +121,3 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf):
|
||||
# Error middleware
|
||||
app = wrap_if_allowed(app, stack, ErrorMiddleware, args=(conf,))
|
||||
return app
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user