sdks/python: mirror Elydora-Python-SDK 2.0.2
Rebuilt from the standalone 54e65eb tree (durable transactions, Kiro IDE adapter, hook retry with a bounded chain lock, version 2.0.2) with the Open-Source API trims re-applied: no token rotation, token issuance, or agent integration updates, and the mirror's registration contract and OpenCode plugin tests kept. Claude-Session: https://claude.ai/code/session_01QoUjdc7HGKTsgj5GhG8HvF
This commit is contained in:
1 parent
b00932d047
commit
1656a94811
56 files changed
+12203
-588
No files matched your search
@@ -3,8 +3,6 @@ from __future__ import annotations
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
from elydora.plugins import _transaction
|
||||
@@ -56,17 +54,21 @@ def test_transaction_rolls_back_every_runtime_and_settings_change(
|
||||
monkeypatch, tmp_path, global_settings={"owner": "user"}
|
||||
)
|
||||
original = fixture.source()
|
||||
real_replace = _transaction.os.replace
|
||||
real_replace = _transaction._replace_physical
|
||||
failed = False
|
||||
|
||||
def fail_settings_commit(source: Any, destination: Any) -> None:
|
||||
def fail_settings_commit(
|
||||
source: str,
|
||||
destination: str,
|
||||
directory: _transaction.PinnedDirectory,
|
||||
) -> None:
|
||||
nonlocal failed
|
||||
if not failed and Path(destination) == fixture.global_path:
|
||||
failed = True
|
||||
raise OSError("simulated Letta settings commit failure")
|
||||
real_replace(source, destination)
|
||||
real_replace(source, destination, directory)
|
||||
|
||||
monkeypatch.setattr(_transaction.os, "replace", fail_settings_commit)
|
||||
monkeypatch.setattr(_transaction, "_replace_physical", fail_settings_commit)
|
||||
with pytest.raises(OSError, match="Install Letta Code hooks"):
|
||||
fixture.install()
|
||||
assert failed
|
||||
|
||||
Reference in new issue
Block a user