feat(notes): update_note + delete_note -- Notizen bearbeiten/loeschen
Notes-MCP konnte nur create/read/search. Neu: - update_note(note_id, title?, body?, notebook?): partielles PUT, nur gesetzte Felder; notebook verschiebt (Name->parent_id-Lookup wie create). - delete_note(note_id, permanent=False): Default Papierkorb, permanent=True loescht endgueltig; Titel wird vorher gelesen fuer klare Rueckmeldung. - Helper _put/_delete analog _post/_get. - Test: voller CRUD-Zyklus in TestNotes (create->update->verify->delete, raeumt hinter sich auf). Alle Notes-Tests gruen (11 passed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XhHNJKk3RsHgUsJ27WQSom
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
330e0113f8
commit
e34711d0ca
@@ -468,6 +468,35 @@ class TestNotes:
|
||||
listing = tool_call(self.PORT, token, "list_notes", {"notebook": self.TEST_NOTEBOOK})
|
||||
assert note_id in listing or f"Test Note {tag}" in listing
|
||||
|
||||
def test_update_delete_note(self):
|
||||
"""Voller CRUD-Zyklus: create -> update (title+body) -> read verify -> delete permanent."""
|
||||
token = get_token(self.PORT)
|
||||
tag = f"mcptest-upd-{int(time.time())}"
|
||||
result = tool_call(self.PORT, token, "create_note", {
|
||||
"notebook": self.TEST_NOTEBOOK,
|
||||
"title": f"Upd Note {tag}",
|
||||
"body": "vorher",
|
||||
})
|
||||
assert "erstellt" in result.lower(), f"Create failed: {result}"
|
||||
note_id = result.split("id: ")[1].rstrip(")").strip()
|
||||
|
||||
# Update title + body
|
||||
result = tool_call(self.PORT, token, "update_note", {
|
||||
"note_id": note_id, "title": f"Upd Note {tag} NEU", "body": f"NACHHER {tag}",
|
||||
})
|
||||
assert "aktualisiert" in result.lower(), f"Update failed: {result}"
|
||||
|
||||
body = tool_call(self.PORT, token, "read_note", {"note_id": note_id})
|
||||
assert f"NACHHER {tag}" in body and "NEU" in body, f"Update not applied: {body[:200]}"
|
||||
|
||||
# Leerer Update-Aufruf gibt klare Meldung statt Fehler
|
||||
result = tool_call(self.PORT, token, "update_note", {"note_id": note_id})
|
||||
assert "Nichts zu aendern" in result
|
||||
|
||||
# Permanent loeschen (Testdaten nicht liegen lassen)
|
||||
result = tool_call(self.PORT, token, "delete_note", {"note_id": note_id, "permanent": True})
|
||||
assert "ENDGUELTIG" in result, f"Delete failed: {result}"
|
||||
|
||||
|
||||
# ============================================================
|
||||
# File Type Tests (read_file auf vorbereiteten /testdata-Dateien)
|
||||
|
||||
Reference in New Issue
Block a user