feat: Project Scaffold and Docker Packaging

This commit is contained in:
OpenVelo Agent
2026-08-04 17:40:20 +00:00
parent a6f236918e
commit 6e3f9249a8
27 changed files with 1093 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
from __future__ import annotations
from pathlib import Path
from tenbackward.state import load_posted, posted_path, save_posted
def test_load_posted_creates_empty_when_missing(tmp_path: Path) -> None:
state = load_posted(tmp_path)
assert state == {}
def test_round_trip_persists(tmp_path: Path) -> None:
state = {"post-1": {"posted_at": "2024-01-01T00:00:00Z"}}
save_posted(tmp_path, state)
assert posted_path(tmp_path).exists()
again = load_posted(tmp_path)
assert again == state
def test_load_posted_handles_corrupt_file(tmp_path: Path) -> None:
posted_path(tmp_path).parent.mkdir(parents=True, exist_ok=True)
posted_path(tmp_path).write_text("not-json")
assert load_posted(tmp_path) == {}
def test_save_posted_creates_parent_dirs(tmp_path: Path) -> None:
nested = tmp_path / "deep" / "data"
save_posted(nested, {"x": 1})
assert posted_path(nested).exists()