Skip to content

tests: Added FlowTests for Tools Entropy Generation and Calc Final Word Flows - #959

Open
PROWLERx15 wants to merge 1 commit into
SeedSigner:devfrom
PROWLERx15:tools-flow-tests
Open

tests: Added FlowTests for Tools Entropy Generation and Calc Final Word Flows#959
PROWLERx15 wants to merge 1 commit into
SeedSigner:devfrom
PROWLERx15:tools-flow-tests

Conversation

@PROWLERx15

Copy link
Copy Markdown
Contributor

Description

This PR implements end-to-end FlowTests for the Tools Entropy Generation (Image & Dice Roll) and Calc Final Word flows.

Problem or Issue being addressed

The "SeedSigner Views' Edge Crawler" (Summer of Bitcoin Project) identified that the Image Entropy, Dice Entropy, and Calc Final Word flows in tools_views.py previously had zero FlowTest coverage.

Solution

  • Image Entropy Flow: Added tests to verify routing from Live Preview to Mnemonic Length selection. Mocked the hardware camera's capture_frame() output by injecting a PIL Image via a before_run hook.
  • Dice Entropy Flow: Added tests for both 12-word and 24-word dice entropy generation flows.
  • Calc Final Word Flows: Added tests covering all three entropy branches (Finalize with Zeros, Coin Flip Entropy, and Word Selection Entropy).
  • Load/Discard Verification: Verified that completing the Calc Final Word flow correctly routes to SeedFinalizeView (Load) and SeedDiscardView (Discard).

Additional Information

The Crawler identified 16 edges in the Tools and Calc Final Word flows that previously had 0% FlowTest coverage. The tests added in this PR successfully cover 100% of the previously untested edges listed below:

Source Target
ToolsMenuView ToolsDiceEntropyMnemonicLengthView
ToolsMenuView ToolsImageEntropyLivePreviewView
ToolsDiceEntropyMnemonicLengthView ToolsDiceEntropyEntryView
ToolsDiceEntropyEntryView SeedWordsWarningView
ToolsImageEntropyLivePreviewView ToolsImageEntropyFinalImageView
ToolsImageEntropyFinalImageView ToolsImageEntropyMnemonicLengthView
ToolsImageEntropyMnemonicLengthView SeedWordsWarningView
ToolsCalcFinalWordCoinFlipsView ToolsCalcFinalWordShowFinalWordView
ToolsCalcFinalWordShowFinalWordView ToolsCalcFinalWordDoneView
ToolsCalcFinalWordFinalizePromptView SeedMnemonicEntryView
ToolsCalcFinalWordFinalizePromptView ToolsCalcFinalWordCoinFlipsView
ToolsCalcFinalWordFinalizePromptView ToolsCalcFinalWordShowFinalWordView
ToolsCalcFinalWordDoneView SeedDiscardView
ToolsCalcFinalWordDoneView SeedFinalizeView
SeedMnemonicEntryView ToolsCalcFinalWordFinalizePromptView
SeedMnemonicEntryView ToolsCalcFinalWordShowFinalWordView

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Documentation
  • Testing

Checklist

I ran pytest locally

  • All tests passed before submitting the PR
  • I couldn't run the tests
  • N/A

I included screenshots of any new or modified screens

Should be part of the PR description above.

  • Yes
  • No
  • N/A

I added or updated tests

Any new or altered functionality should be covered in a unit test. Any new or updated sequences require FlowTests.

  • Yes
  • No, I’m a fool
  • N/A

I tested this PR hands-on on the following platform(s):


I have reviewed these notes:

  • Keep your changes limited in scope.
  • If you uncover other issues or improvements along the way, ideally submit those as a separate PR.
  • The more complicated the PR, the harder it is to review, test, and merge.
  • We appreciate your efforts, but we're a small team of volunteers so PR review can be a very slow process.
  • Please only "@" mention a contributor if their input is truly needed to enable further progress.
  • I understand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Summer of Bitcoin

Development

Successfully merging this pull request may close these issues.

2 participants