Skip to content

Add unit tests for doctrine infrastructure#131

Draft
monkeypants wants to merge 1 commit into
masterfrom
test-doctrine-infrastructure
Draft

Add unit tests for doctrine infrastructure#131
monkeypants wants to merge 1 commit into
masterfrom
test-doctrine-infrastructure

Conversation

@monkeypants
Copy link
Copy Markdown
Contributor

Summary

  • 33 tests for core/parsers/ast.py — class extraction, import scanning, pipeline detection, edge cases
  • 21 tests for core/infrastructure/repositories/introspection/bounded_context.py — BC discovery, filtering, nested solutions, caching
  • 10 tests for core/use_cases/generic_crud.py — Get/List/Create/Update base classes

Context

The doctrine test system depends on ~950 lines of parsing and discovery infrastructure that had zero test coverage. A bug in the AST parser or BC discovery means doctrine tests produce false negatives — violations pass silently. These tests exercise the public API without changing any production code.

Test plan

  • 64 new tests pass
  • 17 existing doctrine tests still pass
  • ruff check clean
  • black --check clean

Fixes #130

The doctrine tests depend on infrastructure with zero test coverage.
A bug in any of these causes false negatives — violations pass silently.

Add tests for the three critical modules:

- core/parsers/ast.py: class extraction, import scanning, pipeline
  detection, module docstrings, edge cases (syntax errors, empty dirs,
  underscore-prefixed files). 33 tests.

- core/infrastructure/repositories/introspection/bounded_context.py:
  BC discovery, reserved word filtering, nested solutions (contrib/),
  structural markers, caching, get-by-slug. 21 tests.

- core/use_cases/generic_crud.py: Get/List/Create/Update base classes
  with a fake entity and in-memory repo. 10 tests.

All tests are pure additions — no changes to production code.

Fixes #130
@monkeypants monkeypants marked this pull request as draft March 26, 2026 11:35
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.

Add unit tests for doctrine infrastructure

1 participant