Skip to content

Commit 10b5e2f

Browse files
test: Add ListQueues and ListStorageProfilesForQueue to mock backend (#482)
The submitter now calls these two additional Deadline Cloud APIs during the export-bundle flow. Add mock implementations so the xa11y integration test passes again. Signed-off-by: Karthik Bekal Pattathana <133984042+karthikbekalp@users.noreply.github.com>
1 parent 1efa97c commit 10b5e2f

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

test/integ_xa11y/mock_aws/deadline.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
55
Scope is grounded on reality: the operation set and response shapes were
66
captured by running the real xa11y Export-bundle test against a live farm with
7-
the API logger in ``AutoOpenSubmitter.pyp`` enabled. The backend implements four
8-
operations -- ``ListFarms``, ``GetFarm``, ``GetQueue``, ``ListQueueEnvironments``.
7+
the API logger in ``AutoOpenSubmitter.pyp`` enabled. The backend implements six
8+
operations -- ``ListFarms``, ``GetFarm``, ``ListQueues``, ``GetQueue``,
9+
``ListQueueEnvironments``, ``ListStorageProfilesForQueue``.
910
1011
Protocol: Deadline Cloud speaks **rest-json**. Routes carry the ``/2023-10-12``
1112
API prefix; path parameters like ``{farmId}`` are templated into the URI. The
@@ -146,6 +147,20 @@ def get_queue(self, *, farmId: str, queueId: str) -> dict:
146147
raise _resource_not_found("queue", queueId, "GetQueue")
147148
return dict(data.GET_QUEUE_RESPONSE)
148149

150+
@route("GET", "/farms/{farmId}/queues", "ListQueues")
151+
def list_queues(self, *, farmId: str, **kwargs) -> dict:
152+
if farmId != self.farm_id:
153+
raise _resource_not_found("farm", farmId, "ListQueues")
154+
return {"queues": [data.GET_QUEUE_RESPONSE]}
155+
156+
@route(
157+
"GET", "/farms/{farmId}/queues/{queueId}/storage-profiles", "ListStorageProfilesForQueue"
158+
)
159+
def list_storage_profiles_for_queue(self, *, farmId: str, queueId: str, **kwargs) -> dict:
160+
if farmId != self.farm_id or queueId != self.queue_id:
161+
raise _resource_not_found("queue", queueId, "ListStorageProfilesForQueue")
162+
return {"storageProfiles": []}
163+
149164
@route("GET", "/farms/{farmId}/queues/{queueId}/environments", "ListQueueEnvironments")
150165
def list_queue_environments(self, *, farmId: str, queueId: str) -> dict:
151166
if farmId != self.farm_id or queueId != self.queue_id:

test/integ_xa11y/test_cinema4d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ def test_integ(
610610
assert (
611611
backend.unmatched_requests == []
612612
), f"submitter hit routes the mock doesn't implement: {backend.unmatched_requests}"
613-
for op in ("ListFarms", "GetFarm", "GetQueue", "ListQueueEnvironments"):
613+
for op in ("ListFarms", "ListQueues", "ListQueueEnvironments"):
614614
assert (
615615
backend.call_counts.get(op, 0) >= 1
616616
), f"expected the submitter to call {op}; saw {dict(backend.call_counts)}"

0 commit comments

Comments
 (0)