Skip to content

Commit 2c60e1a

Browse files
committed
test(openapi): refresh spec fixture to v37.0 and update assertions
The bundled OpenAPI spec fixture (tests/data/specs.yml) was a v22.0 snapshot from 2021. Replace it with the current live spec (v37.0) from https://apispec.connect.cloudblue.com/connect-openapi30.yml so the introspection tests validate against the API's real, current structure. Update the exact-match assertions in test_openapi.py whose expected values changed with the new spec: get_namespaces (11 -> 21), get_collections (18 -> 29), get_actions and get_nested_collections for products. No client code changes: the client is spec-agnostic and only loads the spec for optional help/validation.
1 parent 8d3ff5f commit 2c60e1a

2 files changed

Lines changed: 74202 additions & 29010 deletions

File tree

tests/client/test_openapi.py

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,23 @@ def test_get_namespaces(openapi_specs):
5858
namespaces = openapi_specs.get_namespaces()
5959
assert namespaces == [
6060
'auth',
61-
'conversations',
61+
'billing',
62+
'catalog',
63+
'custom',
64+
'devops',
6265
'dictionary',
66+
'embed',
6367
'helpdesk',
68+
'leads',
69+
'localization',
70+
'modules',
6471
'notifications',
6572
'offers',
73+
'offers-ns',
74+
'pim',
6675
'pricing',
6776
'reporting',
77+
'statistics',
6878
'subscriptions',
6979
'tier',
7080
'usage',
@@ -75,22 +85,33 @@ def test_get_collections(openapi_specs):
7585
cols = openapi_specs.get_collections()
7686
assert cols == [
7787
'accounts',
88+
'acl',
7889
'agreements',
7990
'assets',
91+
'brand',
92+
'brands',
8093
'categories',
8194
'contracts',
95+
'conversations',
8296
'countries',
97+
'domains',
8398
'extensions',
99+
'folders',
84100
'forms',
85101
'hubs',
102+
'idps',
86103
'industries',
87104
'listing-requests',
88105
'listings',
89106
'marketplaces',
90-
'modules',
107+
'metrics',
108+
'news',
91109
'partners',
110+
'portal',
92111
'products',
93112
'requests',
113+
'sla',
114+
'sli',
94115
'users',
95116
]
96117

@@ -125,7 +146,16 @@ def test_get_resource(openapi_specs):
125146

126147
def test_get_actions(openapi_specs):
127148
actions = openapi_specs.get_actions('products/PRD-000')
128-
assert ['endsale', 'resumesale'] == sorted([x[0] for x in actions])
149+
assert [
150+
'endsale',
151+
'items/{item_id}/taxonomies/{taxonomy_id}/attributes',
152+
'items/{item_id}/taxonomies/{taxonomy_id}/attributes/{attribute_id}',
153+
'resumesale',
154+
'taxonomies',
155+
'taxonomies/{id}',
156+
'taxonomies/{taxonomy_id}/attributes',
157+
'taxonomies/{taxonomy_id}/attributes/{attribute_id}',
158+
] == sorted([x[0] for x in actions])
129159

130160

131161
def test_get_action(openapi_specs):
@@ -140,13 +170,16 @@ def test_get_nested_collections(openapi_specs):
140170
nested = openapi_specs.get_nested_collections('products/PRD-000')
141171
assert [
142172
'actions',
143-
'agreements',
144173
'configurations',
145174
'connections',
175+
'guidelines',
176+
'item-groups',
146177
'items',
147178
'localizations',
148179
'media',
180+
'messages',
149181
'parameters',
182+
'taxonomies',
150183
'templates',
151184
'usage',
152185
'versions',

0 commit comments

Comments
 (0)