fix: recover failed Gaussian project builds
This commit is contained in:
@@ -10,6 +10,7 @@ import pytest
|
||||
|
||||
from k1link.simulation.gaussian_pipeline_gateway import (
|
||||
BUILD_REQUEST_SCHEMA,
|
||||
GaussianArchiveUpload,
|
||||
GaussianPipelineGateway,
|
||||
GaussianPipelineGatewayError,
|
||||
GaussianPipelineIntegrityError,
|
||||
@@ -163,6 +164,7 @@ def test_gateway_uploads_and_normalizes_archive_with_tus(tmp_path: Path) -> None
|
||||
received.extend(request.content)
|
||||
return httpx.Response(204, headers={"Upload-Offset": str(len(received))})
|
||||
if request.method == "POST" and request.url.path == "/v1/ingests":
|
||||
assert request.extensions["timeout"]["read"] == 30 * 60.0
|
||||
submitted = json.loads(request.content)
|
||||
assert submitted["archive"] == {
|
||||
"upload_id": "archive-001",
|
||||
@@ -202,6 +204,36 @@ def test_gateway_uploads_and_normalizes_archive_with_tus(tmp_path: Path) -> None
|
||||
assert source.bundle_sha256 == bundle_sha
|
||||
|
||||
|
||||
def test_gateway_surfaces_bounded_provider_rejection_detail(tmp_path: Path) -> None:
|
||||
def handler(_request: httpx.Request) -> httpx.Response:
|
||||
return httpx.Response(
|
||||
400,
|
||||
json={
|
||||
"error": "archive_link",
|
||||
"message": "archive links are not supported",
|
||||
},
|
||||
)
|
||||
|
||||
with (
|
||||
GaussianPipelineGateway(
|
||||
"http://gaussian.test",
|
||||
_token_file(tmp_path),
|
||||
transport=httpx.MockTransport(handler),
|
||||
) as gateway,
|
||||
pytest.raises(
|
||||
GaussianPipelineGatewayError,
|
||||
match=r"HTTP 400.*archive links are not supported",
|
||||
),
|
||||
):
|
||||
gateway.normalize_archive(GaussianArchiveUpload(
|
||||
upload_id="archive-001",
|
||||
archive_name="source.rar",
|
||||
format="rar",
|
||||
sha256="a" * 64,
|
||||
byte_length=128,
|
||||
))
|
||||
|
||||
|
||||
def test_gateway_rejects_incomplete_lcc_bundle(tmp_path: Path) -> None:
|
||||
bundle = tmp_path / "bundle"
|
||||
bundle.mkdir()
|
||||
|
||||
Reference in New Issue
Block a user