Skip to content

Commit 3e53ecb

Browse files
Domantasclaude
andcommitted
[10b-API-TEST] fix(files): real probe step names and results in docs and tests
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 645a4cf commit 3e53ecb

3 files changed

Lines changed: 23 additions & 12 deletions

File tree

‎docs/api/files.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ needs the `files:create` permission.
5757
result = client.api.files.test_files_integration(integration_id)
5858
for step in result["items"]:
5959
print(step["operation"], step["result"], step.get("errors"))
60-
# Upload OK None
61-
# Read OK None
60+
# UploadFile OK None
61+
# GetFile OK None
6262
# ...
6363
```
6464

65-
Each item has `operation`, `result` (`"OK"` or `"Failed"`) and `errors`.
65+
Each item has `operation` (`UploadFile`, `GetFile`, `GetAllFiles`,
66+
`DeleteFile`, in that order), `result` (`"OK"`, `"FAILED"`, or `"NOT_TESTED"`
67+
once an earlier step failed) and `errors`.
6668
When the gateway answers with an error status (for example for an unknown
6769
integration id), the call raises a `NorbixError`, like the other methods; the
6870
gateway's `responseStatus` is in the error's `details`.

‎src/norbix_python/api/files.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ def test_files_integration(self, files_integration_id: str, *, timeout: float |
124124
the ``files:create`` permission, because the probe writes to the storage.
125125
126126
Gives back a dict with ``items`` — one entry per step, each with
127-
``operation``, ``result`` (``"OK"`` or ``"Failed"``) and ``errors``.
127+
``operation`` (``UploadFile``, ``GetFile``, ``GetAllFiles``, ``DeleteFile``),
128+
``result`` (``"OK"``, ``"FAILED"``, or ``"NOT_TESTED"`` once an earlier
129+
step failed) and ``errors``.
128130
"""
129131
return self._transport.send(
130132
target="api",
@@ -301,7 +303,9 @@ async def test_files_integration(self, files_integration_id: str, *, timeout: fl
301303
the ``files:create`` permission, because the probe writes to the storage.
302304
303305
Gives back a dict with ``items`` — one entry per step, each with
304-
``operation``, ``result`` (``"OK"`` or ``"Failed"``) and ``errors``.
306+
``operation`` (``UploadFile``, ``GetFile``, ``GetAllFiles``, ``DeleteFile``),
307+
``result`` (``"OK"``, ``"FAILED"``, or ``"NOT_TESTED"`` once an earlier
308+
step failed) and ``errors``.
305309
"""
306310
return await self._transport.send(
307311
target="api",

‎tests/test_files_routes.py‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ def test_delete_many_files() -> None:
212212

213213
PROBE_ANSWER = {
214214
"items": [
215-
{"operation": "Upload", "result": "OK", "errors": []},
216-
{"operation": "Read", "result": "OK", "errors": []},
217-
{"operation": "List", "result": "OK", "errors": []},
218-
{"operation": "Delete", "result": "Failed", "errors": ["Access denied"]},
215+
{"operation": "UploadFile", "result": "OK", "errors": []},
216+
{"operation": "GetFile", "result": "FAILED", "errors": ["Access denied"]},
217+
{"operation": "GetAllFiles", "result": "NOT_TESTED", "errors": []},
218+
{"operation": "DeleteFile", "result": "NOT_TESTED", "errors": []},
219219
],
220220
"responseStatus": {"errorCode": "", "message": ""},
221221
}
@@ -282,9 +282,14 @@ def test_api_test_files_integration_gives_back_the_parsed_items() -> None:
282282

283283
result = client.api.files.test_files_integration(INTEGRATION_ID)
284284

285-
assert [item["operation"] for item in result["items"]] == ["Upload", "Read", "List", "Delete"]
285+
assert [item["operation"] for item in result["items"]] == [
286+
"UploadFile",
287+
"GetFile",
288+
"GetAllFiles",
289+
"DeleteFile",
290+
]
286291
assert result["items"][0]["result"] == "OK"
287-
assert result["items"][3] == {"operation": "Delete", "result": "Failed", "errors": ["Access denied"]}
292+
assert result["items"][1] == {"operation": "GetFile", "result": "FAILED", "errors": ["Access denied"]}
288293

289294

290295
def test_api_test_files_integration_error_status_raises() -> None:
@@ -326,4 +331,4 @@ async def run() -> Any:
326331
assert request["method"] == "POST"
327332
assert urlparse(request["url"]).path == f"/v2/files/{INTEGRATION_ID}/test"
328333
assert request["headers"]["x-cm-projectid"] == "test-project"
329-
assert result["items"][2]["operation"] == "List"
334+
assert result["items"][2]["operation"] == "GetAllFiles"

0 commit comments

Comments
 (0)