wolfhece._builtin_plugins.grid_adder.tests.test_companion
Unit tests for GridAdderCompanion.
Running these tests
From the project root:
pytest wolfhece/_builtin_plugins/grid_adder/tests/ -v
Mocking strategy
The companion needs a WolfMapViewer instance but tests run headless
(no wx.App, no OpenGL context).
viewerfixtureA
MagicMockwithxmin/xmaxset. It records every call toadd_object,set_status_text, etc.dialogsfixtureA
MagicMockinjected as theDialogProviderso we control whatask_floatreturns without any wx dialog appearing.
Module Contents
- class wolfhece._builtin_plugins.grid_adder.tests.test_companion.TestGridAdderCompanion[source]
Behaviour tests — no wx, no OpenGL required.
- test_start_calls_add_object_when_confirmed(viewer, dialogs)[source]
When the user confirms the dialog, add_object must be called once.
- test_start_does_not_call_add_object_when_cancelled(viewer, dialogs)[source]
When the user cancels the dialog, add_object must NOT be called.
- test_default_size_passed_to_dialog(viewer, dialogs)[source]
The dialog must be opened with the default cell size of 1000.
- test_status_set_after_add(viewer, dialogs)[source]
A status message must be emitted after successfully adding the grid.
Calling menu_build twice must not raise (guards run without wx).