Skip to content

Commit fd61c2d

Browse files
committed
chore: format
1 parent ee32a1b commit fd61c2d

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

nextcloud_mcp_server/client.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ def calculate_score(
304304

305305
return score
306306

307-
async def _cleanup_old_attachment_directory(self, *, note_id: int, old_category: str):
307+
async def _cleanup_old_attachment_directory(
308+
self, *, note_id: int, old_category: str
309+
):
308310
"""
309311
Clean up the attachment directory for a note in its old category location.
310312
Called after a category change to prevent orphaned directories.
@@ -317,7 +319,9 @@ async def _cleanup_old_attachment_directory(self, *, note_id: int, old_category:
317319

318320
logger.info(f"Cleaning up old attachment directory: {old_attachment_dir_path}")
319321
try:
320-
delete_result = await self.delete_webdav_resource(path=old_attachment_dir_path)
322+
delete_result = await self.delete_webdav_resource(
323+
path=old_attachment_dir_path
324+
)
321325
logger.info(f"Cleanup of old attachment directory result: {delete_result}")
322326
return delete_result
323327
except Exception as e:
@@ -444,7 +448,9 @@ async def notes_delete_note(self, *, note_id: int):
444448
)
445449
try:
446450
# delete_webdav_resource expects path relative to user's files dir
447-
delete_result = await self.delete_webdav_resource(path=attachment_dir_path)
451+
delete_result = await self.delete_webdav_resource(
452+
path=attachment_dir_path
453+
)
448454
logger.info(
449455
f"WebDAV deletion for category '{cat}' attachment directory: {delete_result}"
450456
)

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ async def temporary_note(nc_client: NextcloudClient):
7272

7373

7474
@pytest.fixture
75-
async def temporary_note_with_attachment(nc_client: NextcloudClient, temporary_note: dict):
75+
async def temporary_note_with_attachment(
76+
nc_client: NextcloudClient, temporary_note: dict
77+
):
7678
"""
7779
Fixture that creates a temporary note, adds an attachment, and cleans up both.
7880
Yields a tuple: (note_data, attachment_filename, attachment_content).

tests/integration/test_notes_api.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616

1717
@pytest.mark.asyncio
18-
async def test_notes_api_create_and_read(nc_client: NextcloudClient, temporary_note: dict):
18+
async def test_notes_api_create_and_read(
19+
nc_client: NextcloudClient, temporary_note: dict
20+
):
1921
"""
2022
Tests creating a note via the API (using fixture) and then reading it back.
2123
"""
@@ -73,7 +75,9 @@ async def test_notes_api_update(nc_client: NextcloudClient, temporary_note: dict
7375

7476

7577
@pytest.mark.asyncio
76-
async def test_notes_api_update_conflict(nc_client: NextcloudClient, temporary_note: dict):
78+
async def test_notes_api_update_conflict(
79+
nc_client: NextcloudClient, temporary_note: dict
80+
):
7781
"""
7882
Tests that attempting to update with an old etag fails with 412.
7983
"""
@@ -140,7 +144,9 @@ async def test_notes_api_append_content_to_existing_note(
140144
append_text = f"Appended content {uuid.uuid4().hex[:8]}"
141145

142146
logger.info(f"Appending content to note ID: {note_id}")
143-
updated_note = await nc_client.notes_append_content(note_id=note_id, content=append_text)
147+
updated_note = await nc_client.notes_append_content(
148+
note_id=note_id, content=append_text
149+
)
144150
logger.info(f"Note after append: {updated_note}")
145151

146152
# Verify the note was updated
@@ -219,7 +225,9 @@ async def test_notes_api_append_content_multiple_times(
219225
logger.info(f"Performing multiple appends to note ID: {note_id}")
220226

221227
# First append
222-
updated_note = await nc_client.notes_append_content(note_id=note_id, content=first_append)
228+
updated_note = await nc_client.notes_append_content(
229+
note_id=note_id, content=first_append
230+
)
223231

224232
expected_content_after_first = original_content + "\n---\n" + first_append
225233
assert updated_note["content"] == expected_content_after_first

0 commit comments

Comments
 (0)