23 lines
668 B
Python
23 lines
668 B
Python
import re
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
class DocumentationConsistencyTests(unittest.TestCase):
|
|
def test_readme_lists_script_output_json_environment_variables(self) -> None:
|
|
script_env_vars = set()
|
|
for path in (ROOT / "scripts").glob("*.py"):
|
|
script_env_vars.update(re.findall(r'"([A-Z0-9_]+OUTPUT_JSON)"', path.read_text(encoding="utf-8")))
|
|
readme = (ROOT / "README.md").read_text(encoding="utf-8")
|
|
|
|
missing = sorted(name for name in script_env_vars if name not in readme)
|
|
|
|
self.assertEqual(missing, [])
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|