Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions protocol_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ def test_discovery(self):
msg="Shopping service version must be date-based (YYYY-MM-DD)",
)
self.assertEqual(shopping_service.get("version"), expected_version)
self.assertIsNotNone(shopping_service.get("transport") == "rest")
self.assertEqual(
shopping_service.get("transport"),
"rest",
"Shopping service must advertise the REST transport",
)
self.assertIsNotNone(shopping_service.get("endpoint"))

def test_version_negotiation(self):
Expand All @@ -274,7 +278,7 @@ def test_version_negotiation(self):
When the request includes a 'UCP-Agent' header with a compatible version,
then the request succeeds (200/201).
When the request includes a 'UCP-Agent' header with an incompatible version,
then the request fails with 400 Bad Request.
then the request fails with 422 Unprocessable Content.
"""
# Discover shopping service endpoint
discovery_resp = self.client.get("/.well-known/ucp")
Expand All @@ -290,9 +294,10 @@ def test_version_negotiation(self):
if isinstance(shopping_services, list)
else shopping_services
)
self.assertIsNotNone(
(shopping_service.get("transport") == "rest"),
"REST config not found for shopping service",
self.assertEqual(
shopping_service.get("transport"),
"rest",
"Shopping service must advertise the REST transport",
)
self.assertIsNotNone(
shopping_service.get("endpoint"),
Expand Down
Loading