feat: publish lightweight Hermes Nextcloud calendar MCP
Some checks failed
Offline checks / test (3.11) (push) Has been cancelled
Offline checks / test (3.13) (push) Has been cancelled

This commit is contained in:
xeno
2026-09-30 22:53:46 +03:00
commit 91823006e2
44 changed files with 7546 additions and 0 deletions

48
tests/fakes.py Normal file
View File

@@ -0,0 +1,48 @@
from dataclasses import dataclass
from types import SimpleNamespace
@dataclass
class FakeItem:
attributes: dict
secret: bytes
secret_content_type: str
deleted: bool = False
locked: bool = False
def get_secret(self):
return self.secret
def get_attributes(self):
return self.attributes
def is_locked(self):
return self.locked
def delete(self):
self.deleted = True
class FakeCollection:
def __init__(self):
self.session = SimpleNamespace(encrypted=True)
self.items = []
self.locked = False
def is_locked(self):
return self.locked
def search_items(self, attributes):
return iter(
i for i in self.items if not i.deleted and i.attributes == attributes
)
def create_item(
self, label, attributes, secret, replace=False, content_type="text/plain"
):
if replace:
for item in self.search_items(attributes):
item.delete()
item = FakeItem(attributes, secret, content_type)
self.items.append(item)
return item