From 40cecbced243705cfadc4f3b36bc60dca3a2dca6 Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Fri, 23 Oct 2026 13:41:08 -0700 Subject: [PATCH] test(scan): pin only the per-source scope keys beside the review counters --- tests/test_scan_scope.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/test_scan_scope.py b/tests/test_scan_scope.py index f5f085f5..f10fb40d 100644 --- a/tests/test_scan_scope.py +++ b/tests/test_scan_scope.py @@ -38,6 +38,11 @@ def _graph(text): } +def _scope_part(scope): + """The per-source scope keys this module pins (other features add counters).""" + return {key: scope[key] for key in ("files", "roots", "output_folders")} + + class ScanScopeTestCase(AdminAPITestCase): """Helpers: link files the way the scan and the monitor do, spy on reads.""" @@ -342,7 +347,8 @@ class TestPerSourceScope(ScanScopeTestCase): self.assertEqual(walked, [["b"]]) self.assertEqual(reads, ["in_b.png"]) self.assertEqual( - job["scope"], {"files": "all", "roots": [1], "output_folders": 1} + _scope_part(job["scope"]), + {"files": "all", "roots": [1], "output_folders": 1}, ) self.assertEqual( job["outcomes"]["added"], @@ -378,7 +384,8 @@ class TestPerSourceScope(ScanScopeTestCase): unscoped = await self._scan({"scope": "all"}) self.assertEqual( - unscoped["scope"], {"files": "all", "roots": None, "output_folders": 2} + _scope_part(unscoped["scope"]), + {"files": "all", "roots": None, "output_folders": 2}, ) self.assertIn("Scan started · 2 output folders · all files", unscoped["log"][0]) @@ -452,7 +459,7 @@ class TestPerSourceScope(ScanScopeTestCase): self.assertEqual(final["directories"], ["output/a", "output/b"]) self.assertEqual(final["added"], 2) self.assertEqual( - self.api._scan_job.scope, + _scope_part(self.api._scan_job.scope), {"files": "all", "roots": None, "output_folders": 2}, )