fix: use json.dumps(paths) for getinfo multi-path, delete probe script
DSM accepts multiple paths as a JSON array string, not comma-separated. Comma-separated is treated as a single literal path; repeated path[] params return error 400. Confirmed via test_getinfo_multipath.py. - get_info: path param changed from ",".join(paths) to json.dumps(paths) - tests: update multi-path assertion to expect JSON array format Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
import pytest
|
||||
@@ -369,9 +370,9 @@ async def test_get_info_multiple_paths(config: AppConfig) -> None:
|
||||
assert "/data/b.txt" in result
|
||||
assert "2 item(s)" in result
|
||||
|
||||
# Verify the API received both paths as a comma-joined string
|
||||
# Verify the API received paths as a JSON array (confirmed working format)
|
||||
call_params = client.request.call_args[1]["params"]
|
||||
assert call_params["path"] == "/dev/a.txt,/data/b.txt"
|
||||
assert call_params["path"] == json.dumps(["/dev/a.txt", "/data/b.txt"])
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user