38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
import pathlib
|
|
import re
|
|
import unittest
|
|
|
|
ROOT = pathlib.Path(__file__).parents[1]
|
|
|
|
|
|
class ArtifactTests(unittest.TestCase):
|
|
def test_requirements_defer_products(self):
|
|
text = (ROOT / "docs/requirements.md").read_text()
|
|
self.assertIn("Product selection deferred:", text)
|
|
self.assertIn("Open questions", text)
|
|
|
|
def test_architecture_has_products_and_flow(self):
|
|
text = (ROOT / "docs/architecture.md").read_text()
|
|
for product in ("Cloud Run", "Pub/Sub", "Cloud Storage", "Firestore"):
|
|
self.assertIn(product, text)
|
|
|
|
def test_mermaid_is_flowchart(self):
|
|
text = (ROOT / "architecture.mmd").read_text()
|
|
self.assertTrue(text.startswith("flowchart"))
|
|
self.assertIn("Cloud Run", text)
|
|
|
|
def test_terraform_root_is_complete(self):
|
|
main = (ROOT / "terraform/main.tf").read_text()
|
|
self.assertIn("google_cloud_run_v2_service", main)
|
|
self.assertIn("google_pubsub_topic", main)
|
|
self.assertNotRegex(main, r"(?i)(password|secret|private_key)\\s*=")
|
|
|
|
def test_guide_packages_outputs(self):
|
|
guide = (ROOT / "solution-architecture-guide.md").read_text()
|
|
for heading in ("Requirements", "Architecture", "Terraform", "Validation", "Verification"):
|
|
self.assertIn(heading, guide)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|