forked from bitcoinafterlife/bal-electrum-plugin
test(bal): Group E - mock tests with fake wallet giovanna7
Add tests/test_group_e_mock_giovanna7.py (22 GUI-free tests) driven by a
self-contained fake wallet named giovanna7, covering four areas:
- E1 calendar/.ics: reminder-offset distribution (compute_reminder_offsets),
VALARM/TRIGGER shape (TRIGGER;RELATED=END:-P{n}D), iCalendar escaping, and
temporary .ics file creation.
- E2 inheritance/states: loading/adding/removing heirs (Heirs), WillItem
status transitions (VALID->COMPLETE, INVALIDATED clears VALID, PUSHED clears
PUSH_FAIL), Will.only_valid, and heir-change detection.
- E3 connectivity: stubbed get_info_task proving ping_servers_parallel runs
concurrently, fires on_each once per server with the right ok flag, and
writes results back; plus empty-mapping no-op.
- E4 will-executor: is_selected default/set, get_willexecutor_transactions
filtering (only VALID+COMPLETE+not-PUSHED+selected; force re-includes PUSHED),
and compute_id.
CHANGELOG: add entry #9. ruff clean; full suite 239 passed.
This commit is contained in:
35
CHANGELOG.md
35
CHANGELOG.md
@@ -582,3 +582,38 @@ starting on the Desktop) instead of opening it. (D2 was intentionally skipped.)
|
||||
branching.
|
||||
|
||||
**Verification (follow-up):** full suite `217 passed`.
|
||||
|
||||
## 9. Group E - Mock tests with fake wallet "giovanna7"
|
||||
|
||||
**Goal:** add automated, GUI-free mock tests covering four behaviour areas of
|
||||
the plugin, all driven by a single self-contained fake wallet named
|
||||
"giovanna7" (no real Electrum wallet file is needed).
|
||||
|
||||
**What was added:**
|
||||
|
||||
- `tests/test_group_e_mock_giovanna7.py` (new) - 22 tests in four sections:
|
||||
- A fake wallet model (`GiovannaWallet`, `FakeDB`) whose `str(wallet)` is
|
||||
`"giovanna7"`, pre-loaded with two heirs (alice, bob).
|
||||
- **E1 - calendar / .ics:** reminder-offset distribution rules
|
||||
(`compute_reminder_offsets`), VALARM/TRIGGER shape
|
||||
(`TRIGGER;RELATED=END:-P{n}D`), iCalendar escaping of the event text, and
|
||||
writing a temporary `.ics` file (`BalCalendar.write_temp_ics`).
|
||||
- **E2 - inheritance / states:** loading/adding/removing giovanna7's heirs
|
||||
(`Heirs`), and `WillItem` status transitions (VALID -> COMPLETE,
|
||||
INVALIDATED clears VALID, PUSHED clears PUSH_FAIL), `Will.only_valid`, and
|
||||
heir-change detection (`HeirNotFoundException`).
|
||||
- **E3 - connectivity:** stubbing `Willexecutors.get_info_task` to prove that
|
||||
`ping_servers_parallel` contacts giovanna7's servers concurrently (total
|
||||
time far below the sequential sum), fires the per-server `on_each` callback
|
||||
once with the correct ok flag, and writes results back into the mapping;
|
||||
plus the empty-mapping no-op.
|
||||
- **E4 - will-executor:** `is_selected` default/set behaviour, the
|
||||
`get_willexecutor_transactions` filtering rule (only VALID + COMPLETE +
|
||||
not-PUSHED + selected wills are pushed; `force=True` re-includes PUSHED
|
||||
ones), and `compute_id`.
|
||||
|
||||
**Verification:**
|
||||
- `ruff check` on the new test file: clean (all checks passed).
|
||||
- Full test suite: `239 passed` (217 previous + 22 new Group E tests).
|
||||
|
||||
**Outcome:** DONE (delivered as a ZIP for user testing before commit).
|
||||
|
||||
Reference in New Issue
Block a user