Skip to content

Commit 12119d0

Browse files
committed
Address CodeRabbit review: fix test count, scope share cleanup, preserve hide_download=0
1 parent 2e4eef2 commit 12119d0

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

PROGRESS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@
6464
| State || 2 |
6565
| Shares | 5 | 40 |
6666
| System Tags | 6 | 22 |
67-
| **Total** | **47** | **356** |
67+
| **Total** | **47** | **358** |

src/nextcloud_mcp/tools/shares.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def _format_share(share: dict[str, Any]) -> dict[str, Any]:
3333
result["url"] = share["url"]
3434
if share.get("password"):
3535
result["has_password"] = True
36-
if share.get("hide_download"):
36+
if "hide_download" in share:
3737
result["hide_download"] = share["hide_download"]
3838
return result
3939

tests/integration/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ async def _cleanup(client: NextcloudClient) -> None:
142142
with contextlib.suppress(Exception):
143143
shares = await client.ocs_get("apps/files_sharing/api/v1/shares")
144144
for share in shares:
145+
share_path = str(share.get("path", ""))
146+
if share_path != f"/{TEST_BASE_DIR}" and not share_path.startswith(f"/{TEST_BASE_DIR}/"):
147+
continue
145148
with contextlib.suppress(Exception):
146149
await client.ocs_delete(f"apps/files_sharing/api/v1/shares/{share['id']}")
147150
with contextlib.suppress(Exception):

tests/integration/test_shares.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ async def test_update_disable_hide_download(self, nc_mcp: McpTestHelper) -> None
303303
await nc_mcp.call("update_share", share_id=share_id, hide_download=True)
304304
result = await nc_mcp.call("update_share", share_id=share_id, hide_download=False)
305305
updated = json.loads(result)
306-
assert not updated.get("hide_download")
306+
assert updated["hide_download"] == 0
307307

308308
@pytest.mark.asyncio
309309
async def test_update_disable_public_upload(self, nc_mcp: McpTestHelper) -> None:

0 commit comments

Comments
 (0)