31 lines
972 B
Python
31 lines
972 B
Python
from __future__ import annotations
|
|
|
|
import json
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
|
|
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
class DeploymentEntrypointTests(unittest.TestCase):
|
|
def test_default_container_opens_only_xml_processing_mutation(self) -> None:
|
|
dockerfile = (PROJECT_ROOT / "Dockerfile").read_text(encoding="utf-8")
|
|
commands = [
|
|
json.loads(line.removeprefix("CMD "))
|
|
for line in dockerfile.splitlines()
|
|
if line.startswith("CMD ")
|
|
]
|
|
|
|
self.assertEqual(len(commands), 1)
|
|
command = commands[0]
|
|
self.assertEqual(command[:3], ["python", "-m", "arr_web.run"])
|
|
self.assertIn("--enable-processing", command)
|
|
self.assertNotIn("--enable-monthly-generation", command)
|
|
self.assertNotIn("--enable-company-reports", command)
|
|
self.assertNotIn("--enable-agent-writeback", command)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main(verbosity=2)
|