migration: prove standalone maintenance and correct visual evidence
This commit is contained in:
@@ -3,11 +3,16 @@ from __future__ import annotations
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
from tools.build_api_registry import build as build_api_registry
|
||||
from tools.build_architecture_inventory import build as build_architecture_inventory
|
||||
from tools.build_architecture_inventory import (
|
||||
build as build_architecture_inventory,
|
||||
source_metrics,
|
||||
)
|
||||
from tools.verify_baseline import python_test_command
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
@@ -34,6 +39,22 @@ class MaintenanceToolTests(unittest.TestCase):
|
||||
self.assertIn("stop_e2e_server(server)", source)
|
||||
self.assertNotIn('"static/app.js"', source)
|
||||
|
||||
def test_standalone_verifier_excludes_only_migration_comparison_modules(self) -> None:
|
||||
repository_command = python_test_command(preservation_baseline=True)
|
||||
standalone_command = python_test_command(preservation_baseline=False)
|
||||
self.assertIn("discover", repository_command)
|
||||
self.assertTrue(any(item == "tests.test_frontend_contract" for item in standalone_command))
|
||||
self.assertFalse(any("test_preservation_" in item for item in standalone_command))
|
||||
|
||||
def test_architecture_metrics_are_independent_of_checkout_line_endings(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
lf = root / "lf.js"
|
||||
crlf = root / "crlf.js"
|
||||
lf.write_bytes(b"const a = 1;\nconst b = 2;\n")
|
||||
crlf.write_bytes(b"const a = 1;\r\nconst b = 2;\r\n")
|
||||
self.assertEqual(source_metrics(lf), source_metrics(crlf))
|
||||
|
||||
def test_every_tool_has_a_non_mutating_help_path(self) -> None:
|
||||
for path in sorted((ROOT / "tools").glob("*.py")):
|
||||
if path.name.startswith("_"):
|
||||
|
||||
Reference in New Issue
Block a user