Read and write each record through the store its config names, and open one for agents with project-record
CI / tests (pull_request) Successful in 2m14s

This commit is contained in:
2026-11-13 23:54:04 +01:00
parent 854eb63407
commit 084bc74b1c
40 changed files with 624 additions and 161 deletions
+22
View File
@@ -0,0 +1,22 @@
"""Record stores for tests, held to record_store.contract like every backend."""
import dataclasses
from failure import Failure
@dataclasses.dataclass
class MemoryStore:
"""A record held in memory, as a backend outside git holds one. Set fails to make every read and write fail with that reason."""
text: str = ""
label: str = "the record in memory"
tracked: str | None = None
fails: str | None = None
def read(self) -> str | Failure:
return Failure(self.fails) if self.fails else self.text
def write(self, text: str) -> Failure | None:
if self.fails:
return Failure(self.fails)
self.text = text
return None