优化sync_system代码质量

This commit is contained in:
strepsiades
2026-04-01 11:52:57 +08:00
parent eb02fd32a5
commit 8f4727a772
46 changed files with 1431 additions and 890 deletions
@@ -1,6 +1,7 @@
from __future__ import annotations
import tempfile
import logging
from pathlib import Path
import copy
import json
@@ -35,6 +36,12 @@ from tests.fixtures.mock_domain import (
)
def _configure_strategy(strategy, **kwargs):
for key, value in kwargs.items():
setattr(strategy.config, key, value)
strategy.config.log_logic_warnings(node_type=strategy.node_type, logger=logging.getLogger(__name__))
@pytest_asyncio.fixture
async def pipeline_bundle():
register_test_domain()
@@ -166,7 +173,8 @@ async def pipeline_bundle():
await binding_manager.persist()
project_strategy = TestProjectStrategy("test_project", local_collection, remote_collection, binding_manager)
project_strategy.update_config(
_configure_strategy(
project_strategy,
auto_bind=True,
auto_bind_fields=["code"],
depend_fields={},
@@ -176,7 +184,8 @@ async def pipeline_bundle():
)
contract_strategy = TestContractStrategy("test_contract", local_collection, remote_collection, binding_manager)
contract_strategy.update_config(
_configure_strategy(
contract_strategy,
auto_bind=False,
depend_fields={"project_ref": "test_project"},
local_orphan_action=OrphanAction.CREATE_REMOTE,
@@ -468,7 +477,8 @@ async def test_pipeline_create_then_update_completes_in_single_run_with_reload()
remote_ds.add_handler(remote_handler)
project_strategy = TestProjectStrategy("test_project", local_collection, remote_collection, binding_manager)
project_strategy.update_config(
_configure_strategy(
project_strategy,
auto_bind=True,
auto_bind_fields=["code"],
depend_fields={},