Files
nuzlocke-tracker/.beans/nuzlocke-tracker-iam7--unit-tests-for-services-layer.md
Julian Tabel ca736e0f39 Add unit tests for services layer
36 tests covering build_families (linear chains, branching, disjoint,
Shedinja case), resolve_base_form, to_roman (parametrized), and
strip_roman_suffix including round-trip verification.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:05:24 +01:00

1.2 KiB
Raw Blame History

title, status, type, priority, created_at, updated_at, parent
title status type priority created_at updated_at parent
Unit tests for services layer completed task normal 2026-02-10T09:33:08Z 2026-02-21T12:01:23Z nuzlocke-tracker-yzpb

Write unit tests for the business logic in backend/src/app/services/. Currently this is the families.py service which handles Pokemon evolution family resolution.

Checklist

  • Test family resolution with simple linear evolution chains (e.g. A → B → C)
  • Test family resolution with branching evolutions (e.g. Eevee / Shedinja)
  • Test disjoint chains remain separate families
  • Test edge cases: empty list, single-stage Pokemon, base form, middle form
  • Test resolve_base_form: linear, branching, Shedinja, not-in-any-evolution
  • Test to_roman: parametrized 1100, genlocke sequence IV
  • Test strip_roman_suffix: II/III/IV/X, no suffix, round-trip with to_roman

Notes

  • services/families.py contains the core logic for resolving Pokemon evolution families
  • These tests may need mock database sessions or in-memory data depending on how the service queries data
  • If the service methods take a DB session, mock it; if they operate on data objects, pass test data directly