diff --git a/tests/test_fidelity_checkpoint.py b/tests/test_fidelity_checkpoint.py index 5d4c4e2..7dd2240 100644 --- a/tests/test_fidelity_checkpoint.py +++ b/tests/test_fidelity_checkpoint.py @@ -76,6 +76,24 @@ class FidelityCheckpoint(unittest.TestCase): self.assertEqual(receipts.identify_tree(self.original)['files'], receipts.read_json(self.manifest)['files']) + def test_bundled_python_commands_preserve_immutable_tree(self): + self.prepare() + before = receipts.identify_tree(self.output) + for name in ('fidelity_acceptance', 'fidelity_checkpoint', 'fidelity_capture', + 'fidelity_review', 'fidelity_ledger'): + result = subprocess.run( + [sys.executable, '-E', 'tools/recon/' + name + '.py', '--help'], + cwd=self.output, capture_output=True, text=True, timeout=20) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertFalse(list((self.output / 'tools/recon').rglob('*.pyc')), name) + for _ in range(2): + result = subprocess.run( + [sys.executable, '-E', 'tools/recon/fidelity_checkpoint.py', + 'preflight', '--checkpoint', '.'], cwd=self.output, + capture_output=True, text=True, timeout=20) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(receipts.identify_tree(self.output), before) + def test_actual_package_and_resource_bytes_identified(self): self.prepare() manifest = receipts.read_json(self.output / 'manifest.json')