refactor CLI command modules and synchronize docs

This commit is contained in:
windyboy
2026-02-16 12:31:26 +08:00
parent 0be802eac5
commit 2dd329cba9
41 changed files with 1066 additions and 753 deletions
+14 -14
View File
@@ -4,7 +4,7 @@ Tests execution mode handling, dry-run simulation, and actual file operations.
"""
import logging
from datetime import datetime
from datetime import datetime, timezone
from pathlib import Path
from uuid import uuid4
@@ -73,7 +73,7 @@ def sample_plan(temp_test_dir):
return ExecutionPlan(
plan_id=str(uuid4()),
created_at=datetime.now(),
created_at=datetime.now(timezone.utc),
operations=operations,
summary={"move": 1, "rename": 1}
)
@@ -208,7 +208,7 @@ class TestDryRunSimulation:
plan = ExecutionPlan(
plan_id=str(uuid4()),
created_at=datetime.now(),
created_at=datetime.now(timezone.utc),
operations=[no_op_operation],
summary={"no-op": 1}
)
@@ -233,7 +233,7 @@ class TestDryRunSimulation:
plan = ExecutionPlan(
plan_id=str(uuid4()),
created_at=datetime.now(),
created_at=datetime.now(timezone.utc),
operations=[conflicted_operation],
summary={"move": 1}
)
@@ -285,7 +285,7 @@ class TestExecuteMode:
plan = ExecutionPlan(
plan_id=str(uuid4()),
created_at=datetime.now(),
created_at=datetime.now(timezone.utc),
operations=[operation],
summary={"move": 1}
)
@@ -319,7 +319,7 @@ class TestExecuteMode:
plan = ExecutionPlan(
plan_id=str(uuid4()),
created_at=datetime.now(),
created_at=datetime.now(timezone.utc),
operations=[operation],
summary={"move": 1}
)
@@ -352,7 +352,7 @@ class TestExecuteMode:
plan = ExecutionPlan(
plan_id=str(uuid4()),
created_at=datetime.now(),
created_at=datetime.now(timezone.utc),
operations=[conflicted_operation],
summary={"move": 1}
)
@@ -427,7 +427,7 @@ class TestRollbackLog:
plan = ExecutionPlan(
plan_id=str(uuid4()),
created_at=datetime.now(),
created_at=datetime.now(timezone.utc),
operations=operations,
summary={"move": 2}
)
@@ -480,7 +480,7 @@ class TestExecutionSummary:
plan = ExecutionPlan(
plan_id=str(uuid4()),
created_at=datetime.now(),
created_at=datetime.now(timezone.utc),
operations=operations,
summary={"move": 2, "no-op": 1}
)
@@ -573,7 +573,7 @@ class TestRollbackLogSaving:
data = json.load(f)
# Verify timestamps are in ISO format
from datetime import datetime
from datetime import datetime, timezone
executed_at = datetime.fromisoformat(data["executed_at"])
assert executed_at is not None
@@ -670,7 +670,7 @@ class TestRollbackExecution:
plan = ExecutionPlan(
plan_id=str(uuid4()),
created_at=datetime.now(),
created_at=datetime.now(timezone.utc),
operations=operations,
summary={"move": 2}
)
@@ -759,7 +759,7 @@ class TestRollbackExecution:
plan = ExecutionPlan(
plan_id=str(uuid4()),
created_at=datetime.now(),
created_at=datetime.now(timezone.utc),
operations=operations,
summary={"move": 1, "no-op": 1}
)
@@ -877,7 +877,7 @@ class TestRollbackExecution:
plan = ExecutionPlan(
plan_id=str(uuid4()),
created_at=datetime.now(),
created_at=datetime.now(timezone.utc),
operations=operations,
summary={"move": 2}
)
@@ -920,7 +920,7 @@ class TestRollbackExecution:
plan = ExecutionPlan(
plan_id=str(uuid4()),
created_at=datetime.now(),
created_at=datetime.now(timezone.utc),
operations=[
FileOperation(
operation_type="quarantine",