Skip to content

test(ui): expand automated unit test coverage across all DockWidget modules to 91% - #151

Merged
Koyandechirag merged 5 commits into
FOSSEE:masterfrom
muaviz:test/dockwidget-coverage
Nov 16, 2026
Merged

Koyandechirag merged 5 commits into
FOSSEE:masterfrom
muaviz:test/dockwidget-coverage

Conversation

@muaviz

@muaviz muaviz commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR significantly expands unit test coverage across all DockWidget modules (src/main/python/DockWidgets/), lifting the module coverage from the baseline ~61% to 91%, wit
all 541 automated tests passing cleanly across the repository.

Upstream changes from master (including PRs #145, #146, #147, #148, #150) have also been merged cleanly with zero regressions.


Coverage Improvements by Module

Module Baseline New Coverage Status
DistillationColumnStagewiseResults.py 100% 100% Maintained
DockWidgetDistillationColumn.py 51% 95% +44%
DockWidgetMaterialStream.py 52% 93% +41%
DockWidgetSplitter.py 50% 93% +43%
DockWidgetCompoundSeparator.py 70% 91% +21%
DockWidgetFlash.py 87% 90% +3%
DockWidget.py (Base & Generic DockWidgets) 66% 90% +24%
DockWidgetShortcutColumn.py 69% 89% +20%
DockWidgetCompressorExpander.py 64% 88% +24%
DockWidgetMixer.py 84% 87% +3%
TOTAL (DockWidgets/) 61% 91% +30% overall

Key Test Additions & Logic Covered

  1. Splitter (DockWidgetSplitter.py: 93%):

    • Dynamic outlet count adjustment (on_output_count_changed) and dynamic field reconstruction.
    • Calculation mode switching (Split_Ratio, Molar_Flow, Mass_Flow).
    • auto_distribute_from_input and get_input_flow extraction from upstream connected material streams, including edge cases (no stream connected, negative flow).
    • Component name updates (update_connected_component_names), dock autosizing (_autosize), and input validation (empty fields, negative values, sum mismatches).
  2. Distillation Column (DockWidgetDistillationColumn.py: 95%):

    • Full parameter submission handling across all stages and condenser/reboiler specs.
    • Simulation results parsing via results_category(): populates the main properties table and stagewise tables (stage_res_table.T_table and stage_res_table.x_pc_table).
    • Covered showStagewiseResults(), showResult(), clear_results(), and dynamic condenser/reboiler dropdown transitions (fun2(), fun3()).
  3. Material Stream (DockWidgetMaterialStream.py: 93%):

    • Tested all 5 flash modes (PT, PH, PVF, TVF, PS).
    • Tested amounts table updates across all composition bases (Mole Fraction, Mass Fraction, Mole Flow, Mass Flow).
    • Tested equalize(), normalize(), update_compounds(), and full simulation results parsing into phase and vapor pressure tables.
  4. Compressor & Expander (DockWidgetCompressorExpander.py: 88%):

    • Added unit tests for both AdiabaticCompressor and AdiabaticExpander across all operation modes (Pdel, Pout, Q).
    • Tested parameter submission, tooltip updates on graphics items, scrollbar adjustments, and simulation results categorization.
  5. Base DockWidget & Remaining Modules (DockWidget.py: 90%, CompoundSeparator: 91%, ShortcutColumn: 89%, Mixer: 87%, Flash: 90%):

    • Added tests for BaseDockWidget renaming validation (duplicate names, invalid characters, empty strings), energy stream cascading (EngStms), flowsheet result_data
      updates, and get_node_item() canvas lookups.
    • Tested set_read_only() state propagation across all controls.
    • Added full parameter submission, compound update, and result parsing tests for CompoundSeparator, ShortcutColumn, Mixer, and Flash.

@Koyandechirag
Koyandechirag merged commit e2d8a00 into FOSSEE:master Nov 16, 2026
1 check passed
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.

2 participants