Files
claude-config/bin/repo_checks/test_ci.py
T

23 lines
786 B
Python

import pathlib
import re
import sys
import unittest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from repo_checks import ROOT
from repo_checks.test_types import SUPPORTED
class Ci(unittest.TestCase):
def test_ci_runs_the_python_readme_install_names(self):
image = re.search(r"python:(3\.\d+)\.\d+", (ROOT / "ci.sh").read_text(encoding="utf-8"))
supported = SUPPORTED.search((ROOT / "README.md").read_text(encoding="utf-8"))
self.assertIsNotNone(image, "ci.sh runs a python:3.N.P image")
self.assertIsNotNone(supported, "README.md's Install names `the latest stable Python, today 3.N`")
self.assertEqual(image.group(1), supported.group(1), "ci.sh's image follows the Python README.md's Install names")
if __name__ == "__main__":
unittest.main()