AI Implementation feature(1082): Project Scaffold and Docker Packaging (#1)

This commit was merged in pull request #1.
This commit is contained in:
2026-08-04 17:40:24 +00:00
parent d0eed251af
commit 33c6c76ce9
27 changed files with 1098 additions and 0 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()