Files
self-hosted-service-account…/tests/test_contract.py
T

14 lines
791 B
Python

from pathlib import Path
import unittest
ROOT=Path(__file__).resolve().parents[1]
class Recovery(unittest.TestCase):
def test_authority_and_original_identity(self):
text=(ROOT/'SKILL.md').read_text()
for s in ["explicitly authorized", "Never switch to a sibling agent's token", 'conditional/idempotent', 'exactly one affected record', 'original token/key', 'does not waive']:
self.assertIn(s,text)
def test_complete_reference_and_narrow_mutation(self):
text=(ROOT/'references/gitea-on-truenas-reactivation.md').read_text()
for s in ['exact account reactivation is authorized', 'UPDATE 1', 'is_active = false', 'Do not alter password', 'prohibit_login=false', 'read-only `git ls-remote`', 'Do not save or print']:
self.assertIn(s,text)
if __name__=='__main__':unittest.main()