Simplify Athena operator architecture

This commit is contained in:
Mikei386
2026-08-25 21:53:12 +02:00
parent c25e57af57
commit 0a640e76ea
22 changed files with 577 additions and 1522 deletions
+26
View File
@@ -70,6 +70,32 @@ class OperatorTests(unittest.TestCase):
with self.assertRaises(ValueError):
self.module.execute({"ticket": proposal["ticket"], "confirmation": proposal["required_confirmation"]})
def test_direct_change_applies_authorized_work_without_ticket(self):
before = self.module.sha((self.repo / "docs" / "test.md").read_bytes())
result = self.module.change({
"operation": "patch_update",
"payload": {"files": [{
"path": "docs/test.md", "expected_sha256": before,
"patch": "@@ -1 +1 @@\n-before\n+after\n",
}]},
})
self.assertEqual(result["operation"], "patch_update")
self.assertEqual((self.repo / "docs" / "test.md").read_text(), "after\n")
self.assertEqual((self.stack / "docs" / "test.md").read_text(), "after\n")
def test_single_worktree_is_written_only_once(self):
self.module.STACK = self.repo
before = self.module.sha((self.repo / "docs" / "test.md").read_bytes())
result = self.module.change({
"operation": "patch_update",
"payload": {"files": [{
"path": "docs/test.md", "expected_sha256": before,
"patch": "@@ -1 +1 @@\n-before\n+after\n",
}]},
})
self.assertEqual(result["operation"], "patch_update")
self.assertEqual((self.repo / "docs" / "test.md").read_text(), "after\n")
def test_wrong_confirmation_and_expired_ticket_are_rejected(self):
proposal = self.prepare_file()
with self.assertRaises(PermissionError):