chore: Upgrade pydantic Config to ConfigDict

This commit is contained in:
Chris Coutinho
2025-10-24 06:18:13 +02:00
parent 81ca799410
commit 13f76a7734
3 changed files with 26 additions and 25 deletions
@@ -273,9 +273,9 @@ async def test_file_list_permissions(alice_mcp_client, bob_mcp_client):
if not result.isError:
response_data = json.loads(result.content[0].text)
if not isinstance(response_data, list):
response_data = [response_data] if response_data else []
file_names = [f["name"] for f in response_data]
# Extract files from DirectoryListing response
files = response_data.get("files", [])
file_names = [f["name"] for f in files]
logger.info(f"Alice can see files: {file_names}")
# Alice should see her own files
@@ -291,9 +291,9 @@ async def test_file_list_permissions(alice_mcp_client, bob_mcp_client):
if not result.isError:
response_data = json.loads(result.content[0].text)
if not isinstance(response_data, list):
response_data = [response_data] if response_data else []
file_names = [f["name"] for f in response_data]
# Extract files from DirectoryListing response
files = response_data.get("files", [])
file_names = [f["name"] for f in files]
logger.info(f"Bob can see files: {file_names}")
# Bob should see his own file, but not Alice's private file
@@ -379,12 +379,12 @@ async def test_folder_share_permissions(alice_mcp_client, bob_mcp_client):
if not result.isError:
response_data = json.loads(result.content[0].text)
if not isinstance(response_data, list):
response_data = [response_data] if response_data else []
logger.info(f"Bob can see {len(response_data)} files in shared folder")
# Extract files from DirectoryListing response
files = response_data.get("files", [])
logger.info(f"Bob can see {len(files)} files in shared folder")
# Bob should see the file in the shared folder
file_names = [f["name"] for f in response_data]
file_names = [f["name"] for f in files]
assert "document.txt" in file_names, (
"Bob should see the file in shared folder"
)
+12 -7
View File
@@ -470,16 +470,21 @@ async def test_mcp_webdav_workflow(
logger.info(f"Directory listing response: {listing_text}")
listing_data = json.loads(listing_text)
# Ensure listing_data is a list
if not isinstance(listing_data, list):
logger.warning(
f"Expected directory listing to be a list, got: {type(listing_data)}"
)
listing_data = [listing_data] if listing_data else []
# Extract files from DirectoryListing response
assert "files" in listing_data, "Expected 'files' field in directory listing"
files = listing_data["files"]
assert isinstance(files, list), (
f"Expected files to be a list, got: {type(files)}"
)
# Verify metadata
assert listing_data["path"] == test_dir
assert listing_data["total_count"] >= 1
assert listing_data["files_count"] >= 1
# Find our file in the listing
found_file = None
for item in listing_data:
for item in files:
if isinstance(item, dict) and item.get("name") == test_file:
found_file = item
break