mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-07-08 11:56:59 +00:00
Stabilize local dev merge
Align regression tests with the current Odysseus behavior after merging origin/dev into local main. - keep phone/name-only contacts valid and cover null email without crashes - pin explicit web-search false form submission in chat.js - update Cookbook dependency/download completion tests for combined live + persisted output - expose SGLang OS package repair hints from backend diagnosis - treat MLX and MLX-community repos as servable on Apple Metal while keeping CUDA behavior unchanged - keep desktop new-chat coverage on the shared preferred-model helper - remove a hardcoded crop overlay portal z-index literal - include the local agent-loop cleanup that removes the old manage_notes reminder repair shim Verified with: docker run --rm -v /home/pewds/odysseus-cookbook-fresh:/app -w /app odysseus-cookbook-fresh-odysseus python3 -m pytest -q (4515 passed, 4 skipped).
This commit is contained in:
@@ -24,7 +24,11 @@ def _add_handler():
|
||||
def _stub_store(monkeypatch):
|
||||
created = []
|
||||
monkeypatch.setattr(cr, "_fetch_contacts", lambda *a, **k: [])
|
||||
monkeypatch.setattr(cr, "_create_contact", lambda name, email: created.append((name, email)) or True)
|
||||
monkeypatch.setattr(
|
||||
cr,
|
||||
"_create_contact",
|
||||
lambda name, email="", address="", phones=None: created.append((name, email, address, phones or [])) or True,
|
||||
)
|
||||
return created
|
||||
|
||||
|
||||
@@ -33,10 +37,18 @@ def test_null_name_does_not_crash(_stub_store):
|
||||
result = asyncio.run(handler({"name": None, "email": "x@y.com"}, _admin="admin"))
|
||||
assert result["success"] is True
|
||||
# name fell back to the email local-part instead of crashing.
|
||||
assert _stub_store == [("x", "x@y.com")]
|
||||
assert _stub_store == [("x", "x@y.com", "", [])]
|
||||
|
||||
|
||||
def test_null_email_is_rejected_cleanly(_stub_store):
|
||||
def test_null_email_does_not_crash(_stub_store):
|
||||
handler = _add_handler()
|
||||
result = asyncio.run(handler({"name": "Bob", "email": None}, _admin="admin"))
|
||||
assert result == {"success": False, "error": "Email required"}
|
||||
assert result["success"] is True
|
||||
assert _stub_store == [("Bob", "", "", [])]
|
||||
|
||||
|
||||
def test_phone_only_contact_is_allowed(_stub_store):
|
||||
handler = _add_handler()
|
||||
result = asyncio.run(handler({"name": "Bob", "email": None, "phone": "0805412 7841"}, _admin="admin"))
|
||||
assert result["success"] is True
|
||||
assert _stub_store == [("Bob", "", "", ["0805412 7841"])]
|
||||
|
||||
Reference in New Issue
Block a user