Skip to content

Commit db85281

Browse files
committed
Update tc0002_sync_list_validation.py
Update Test Case 0002 scenario validation
1 parent f6d86ed commit db85281

1 file changed

Lines changed: 9 additions & 18 deletions

File tree

ci/e2e/testcases/tc0002_sync_list_validation.py

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,18 @@ class SyncListScenario:
4444

4545
def expanded_allowed_exact(self) -> set[str]:
4646
"""
47-
Expand allowed exact paths to include ancestor directories.
47+
Return only the explicitly allowed exact paths.
48+
49+
Do not automatically promote ancestor/container paths to required
50+
allowed paths, because sync_list processing may legitimately skip
51+
container directories while still including matching descendants.
4852
"""
4953
expanded: set[str] = set()
5054

5155
for item in self.allowed_exact:
5256
path = item.strip("/")
53-
if not path:
54-
continue
55-
56-
parts = path.split("/")
57-
for idx in range(1, len(parts) + 1):
58-
expanded.add("/".join(parts[:idx]))
59-
60-
for prefix in self.allowed_prefixes:
61-
path = prefix.strip("/")
62-
if not path:
63-
continue
64-
65-
parts = path.split("/")
66-
for idx in range(1, len(parts)):
67-
expanded.add("/".join(parts[:idx]))
57+
if path:
58+
expanded.add(path)
6859

6960
return expanded
7061

@@ -177,6 +168,7 @@ def run(self, context: E2EContext) -> TestResult:
177168
context.onedrive_bin,
178169
"--sync",
179170
"--verbose",
171+
"--verbose",
180172
"--resync",
181173
"--resync-auth",
182174
"--syncdir",
@@ -547,14 +539,13 @@ def _build_scenarios(self) -> list[SyncListScenario]:
547539
f"{FIXTURE_ROOT_NAME}/Documents/latest_report.docx",
548540
],
549541
allowed_exact=[
550-
f"{FIXTURE_ROOT_NAME}/Documents",
551542
f"{FIXTURE_ROOT_NAME}/Documents/latest_report.docx",
552543
],
553544
required_processed=[
554545
f"{FIXTURE_ROOT_NAME}/Documents/latest_report.docx",
555546
],
556547
required_skipped=[
557-
f"{FIXTURE_ROOT_NAME}/Documents/report.pdf",
548+
f"{FIXTURE_ROOT_NAME}/Documents/Notes",
558549
f"{FIXTURE_ROOT_NAME}/Backup",
559550
],
560551
),

0 commit comments

Comments
 (0)