diff --git a/rest/python/server/integration_test.py b/rest/python/server/integration_test.py index c4f3186..7cc5590 100644 --- a/rest/python/server/integration_test.py +++ b/rest/python/server/integration_test.py @@ -45,14 +45,16 @@ from ucp_sdk.models.schemas.shopping.types import ( payment_instrument as payment_instr_type, ) -from ucp_sdk.models.schemas.shopping.ap2_mandate import Checkout as Ap2Checkout -from ucp_sdk.models.schemas.shopping.buyer_consent import ( +from ucp_sdk.models.schemas.shopping.ap2_mandate.dev.ucp.shopping import ( + Checkout as Ap2Checkout, +) +from ucp_sdk.models.schemas.shopping.buyer_consent.dev.ucp.shopping import ( Checkout as BuyerConsentCheckoutResp, ) -from ucp_sdk.models.schemas.shopping.discount import ( +from ucp_sdk.models.schemas.shopping.discount.dev.ucp.shopping import ( Checkout as DiscountCheckoutResp, ) -from ucp_sdk.models.schemas.shopping.fulfillment import ( +from ucp_sdk.models.schemas.shopping.fulfillment.dev.ucp.shopping import ( Checkout as FulfillmentCheckout, ) from ucp_sdk.models.schemas.shopping.order import PlatformSchema diff --git a/rest/python/server/models.py b/rest/python/server/models.py index e1197c0..0547f0e 100644 --- a/rest/python/server/models.py +++ b/rest/python/server/models.py @@ -20,17 +20,19 @@ """ from typing import Any -from ucp_sdk.models.schemas.shopping.ap2_mandate import Checkout as Ap2Checkout -from ucp_sdk.models.schemas.shopping.buyer_consent import ( +from ucp_sdk.models.schemas.shopping.ap2_mandate.dev.ucp.shopping import ( + Checkout as Ap2Checkout, +) +from ucp_sdk.models.schemas.shopping.buyer_consent.dev.ucp.shopping import ( Checkout as BuyerConsentCheckoutResp, ) -from ucp_sdk.models.schemas.shopping.discount import ( +from ucp_sdk.models.schemas.shopping.discount import DiscountsObject +from ucp_sdk.models.schemas.shopping.discount.dev.ucp.shopping import ( Checkout as DiscountCheckoutResp, - DiscountsObject, ) -from ucp_sdk.models.schemas.shopping.fulfillment import ( +from ucp_sdk.models.schemas.shopping.fulfillment import Fulfillment +from ucp_sdk.models.schemas.shopping.fulfillment.dev.ucp.shopping import ( Checkout as FulfillmentCheckout, - Fulfillment, ) from ucp_sdk.models.schemas.shopping.order import Order diff --git a/rest/python/server/server_import_test.py b/rest/python/server/server_import_test.py new file mode 100644 index 0000000..8d24e18 --- /dev/null +++ b/rest/python/server/server_import_test.py @@ -0,0 +1,29 @@ +# Copyright 2026 UCP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Smoke tests for the sample server module.""" + +import importlib +from pathlib import Path +import sys + + +def test_server_module_imports(monkeypatch) -> None: + """The sample server should import with the current Python SDK models.""" + monkeypatch.syspath_prepend(str(Path(__file__).parent)) + sys.modules.pop("server", None) + + server = importlib.import_module("server") + + assert server.app is not None