Skip to content

## Test coverage: sync

Test coverage: sync.py filter/CSL/workspace integration

Add tests for _sync_lua_filter, _sync_csl_files, and a lightweight sync_workspace integration test in src/projio/sync.py.

What to test

  • _sync_lua_filter(): copies bundled include.lua to .projio/filters/, detects updates via SHA256. Test: first copy, unchanged skip, updated file, dry_run.
  • _sync_csl_files(): copies bundled CSL styles to .projio/render/csl/. Test: first copy, skip, update, dry_run.
  • sync_workspace() integration: scaffold a minimal project with projio init, then run sync_workspace() and verify: config unchanged, Lua filter copied, no crashes. This is the test that would have caught the missing import yaml bug.

Where

  • Source: src/projio/sync.py:156-195 (filter), 197-235 (CSL), 890-1010 (sync_workspace)
  • Tests: add to tests/test_sync.py

Approach

For filter/CSL: use tmp_path with .projio/ dir. Bundled files are read from package data (no mocking needed — they're part of the install). For sync_workspace: scaffold with projio.init.scaffold() first, then call sync_workspace(). Assert no exceptions, key outputs exist.

Batch Result

  • status: done
  • batch queue_id: fa9ae36ce1aa
  • session: bf8a344f-5f23-4791-ab7b-17a624a7fc7f
  • batch duration: 441.8s