Files
ai-exchange/tests/unit/test_deploy_with_password.py
T
2026-05-11 23:37:47 +08:00

34 lines
1.3 KiB
Python

import unittest
from pathlib import Path
from scripts import deploy_with_password
class DeployWithPasswordTests(unittest.TestCase):
def test_deploy_payload_includes_automation_anchor_files(self) -> None:
self.assertIn(".dockerignore", deploy_with_password.DEPLOY_PATHS)
self.assertIn("docs", deploy_with_password.DEPLOY_PATHS)
self.assertIn("SESSION.md", deploy_with_password.DEPLOY_PATHS)
self.assertIn("TASKS.md", deploy_with_password.DEPLOY_PATHS)
def test_docker_image_includes_automation_anchor_files(self) -> None:
dockerfile = Path("Dockerfile").read_text(encoding="utf-8")
self.assertIn("COPY docs /app/docs", dockerfile)
self.assertIn("COPY SESSION.md /app/SESSION.md", dockerfile)
self.assertIn("COPY TASKS.md /app/TASKS.md", dockerfile)
def test_dockerignore_does_not_exclude_automation_docs(self) -> None:
dockerignore = Path(".dockerignore").read_text(encoding="utf-8").splitlines()
self.assertNotIn("docs/", dockerignore)
def test_compose_persists_automation_monitor_state(self) -> None:
compose = Path("docker-compose.yml").read_text(encoding="utf-8")
self.assertIn("./.claude:/app/.claude", compose)
if __name__ == "__main__":
unittest.main()