Skip to content

refactor: reorganize tests into subdirectories matching src structure - #11

Merged
codeasier merged 1 commit into
mainfrom
refactor/test-directory-structure
Apr 12, 2026
Merged

codeasier merged 1 commit into
mainfrom
refactor/test-directory-structure

Conversation

@codeasier

Copy link
Copy Markdown
Owner

📝 Description

  • Move 6 query-related tests to tests/query/ subdirectory
  • Move 3 model-related tests to tests/models/ subdirectory
  • Add __init__.py to each subdirectory
  • No test content or import changes — all use absolute imports

This aligns the test structure with src/pt_snap_cli/ for better navigation and maintainability.

🔗 Related Issue

Fixes #10

🧪 Testing

  • Tests added/updated
  • Manual testing completed

✅ Checklist

  • Code follows project guidelines
  • Documentation updated (if applicable)
  • No new warnings introduced
  • Changes tested locally

📸 Screenshots (if applicable)

📋 Additional Notes

Verification

pytest --cov              ✅ 191 passed, 92% coverage
pytest tests/query/       ✅ 108 passed (subdirectory isolation)
pytest tests/models/      ✅ 16 passed (subdirectory isolation)
ruff check .              ✅ All checks passed
black --check .           ✅ 34 files unchanged

New structure

tests/
├── conftest.py
├── test_cli.py
├── test_config.py
├── test_context.py
├── test_models.py
├── test_package.py
├── query/
│   ├── __init__.py
│   ├── test_builder.py
│   ├── test_condition.py
│   ├── test_config.py
│   ├── test_executor.py
│   ├── test_mapper.py
│   └── test_registry.py
└── models/
    ├── __init__.py
    ├── test_block.py
    ├── test_enums.py
    └── test_event.py

Move query-related tests to tests/query/ and model-related tests to
tests/models/ to align with the src/pt_snap_cli/ directory structure.
No test content or imports were modified — all imports use absolute
paths (from pt_snap_cli.xxx import ...) that work unchanged.
@codeasier
codeasier merged commit b73c679 into main Apr 12, 2026
5 checks passed
@codeasier
codeasier deleted the refactor/test-directory-structure branch April 17, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] 测试目录结构优化 — 按模块分组对齐 src-layout

1 participant