Skip to content

Add unit tests for MetricCalculatorLogic command building#25

Merged
tctco merged 1 commit into
devfrom
codex/fix-bug-in-centaur-calculation
May 20, 2026
Merged

Add unit tests for MetricCalculatorLogic command building#25
tctco merged 1 commit into
devfrom
codex/fix-bug-in-centaur-calculation

Conversation

@tctco
Copy link
Copy Markdown
Owner

@tctco tctco commented May 20, 2026

Motivation

  • Verify that MetricCalculatorLogic builds correct CLI commands for different metric types and flag combinations.
  • Allow these unit tests to run in CI by stubbing out unavailable runtime GUI dependencies (qt and slicer).

Description

  • Add localizer/src/tests/test_ui_metric_command_builder.py which injects localizer/lib on sys.path and provides a _load_metric_calculator_logic helper that stubs qt and slicer before importing MetricCalculatorLogic.
  • Add test_build_command_uses_subcommand_cli_for_centaur to assert the centaur subcommand, presence of --input/--output, and handling of --manual-fov and --skip-normalization.
  • Add test_build_command_fillstates_requires_tracer_and_no_suvr and test_build_suvr_command_does_not_reference_legacy_flag to validate tracer handling for Fill States and that suvr commands do not reference legacy flags.

Testing

  • Ran pytest localizer/src/tests/test_ui_metric_command_builder.py and the tests completed successfully.

Codex Task

@tctco tctco merged commit 23e5200 into dev May 20, 2026
2 of 5 checks passed
@tctco tctco deleted the codex/fix-bug-in-centaur-calculation branch May 20, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant