Commit 9d950016 authored by George Papathanail's avatar George Papathanail
Browse files

fix(tests): wire repos into conformance harness accept 400 for unregistered appId

parent 94f6f3d6
Loading
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -25,7 +25,11 @@ from open_exposure_gateway.dependencies import (
from open_exposure_gateway.domain.edge_application_management import ResourceZone
from tests.conformance.harness import app
from tests.unit.fakes import (
    FakeAppInstanceRepository,
    FakeAppRegistrationRepository,
    FakeCallbackRegistrationRepository,
    FakeDataBus,
    FakeOperationRepository,
    FakeSRMClient,
    wire_operation_consumer,
    wire_srm_worker,
@@ -50,7 +54,12 @@ def service_overrides() -> Generator[None, None, None]:
    wire_operation_consumer(bus)
    wire_srm_worker(bus, srm)
    app.dependency_overrides[get_edge_app_service] = lambda: EdgeApplicationManagementService(
        srm_client=srm, publisher=bus
        srm_client=srm,
        publisher=bus,
        app_registration_repo=FakeAppRegistrationRepository(),
        operation_repo=FakeOperationRepository(),
        app_instance_repo=FakeAppInstanceRepository(),
        callback_registration_repo=FakeCallbackRegistrationRepository(),
    )
    app.dependency_overrides[get_qod_service] = lambda: QualityOnDemandService(srm_client=srm)
    app.dependency_overrides[get_publisher] = lambda: bus
+6 −0
Original line number Diff line number Diff line
@@ -41,6 +41,12 @@ schema.config.generation.update(max_examples=10, no_shrink=True)
# not_a_server_error check flags any 5xx by default regardless of the spec
# (see schemathesis/schemathesis#2539).
schema.config.checks.not_a_server_error.expected_statuses.append("501")
# 400 for a schema-valid but unregistered appId is a deliberate choice to stay
# within createAppInstance's literally-documented response codes (400/401/403/
# 409/500/501/503 — no 404 listed), even though CAMARA's own Generic400 vs
# Generic404 semantics would suggest 404. Schemathesis's positive_data_acceptance
# check otherwise flags this as rejecting schema-compliant data.
schema.config.checks.positive_data_acceptance.expected_statuses.append("400")


@schema.parametrize()