refactor tests
Publish container image / Build and push (push) Successful in 32s

This commit is contained in:
2026-07-26 23:49:40 +02:00
parent 5ef10d28fe
commit ce9f1e3d20
32 changed files with 1546 additions and 1923 deletions
+1 -20
View File
@@ -1,5 +1,3 @@
from dataclasses import replace
from enum import StrEnum
from typing import cast
import pytest
@@ -43,6 +41,7 @@ async def test_dispatch_routes_every_job_kind_and_returns_body(
kind: JobKind,
expected_route: str,
) -> None:
assert {route_kind for route_kind, _ in ROUTES} == set(JobKind)
calls: list[tuple[str, Job]] = []
def route(name: str):
@@ -73,21 +72,3 @@ async def test_dispatch_rejects_unparsed_command() -> None:
cast(JobRun, object()),
cast(WorkflowServices, object()),
)
class UnsupportedKind(StrEnum):
UNKNOWN = "unknown"
async def test_dispatch_rejects_unsupported_kind() -> None:
unsupported = UnsupportedKind.UNKNOWN
job = replace(make_job(JobKind.PLAN), kind=cast(JobKind, unsupported))
with pytest.raises(KeyError) as error:
await dispatch_module.dispatch(
job,
cast(JobRun, object()),
cast(WorkflowServices, object()),
)
assert error.value.args == (unsupported,)